Merge pull request #10271 from demarches-simplifiees/sidekiq_part_of_api_entreprise
Tech: déplace APIEntreprise vers sidekiq
This commit is contained in:
commit
f5397268a6
4 changed files with 11 additions and 2 deletions
|
@ -126,7 +126,7 @@ class APIEntreprise::API
|
|||
elsif response.code == 400
|
||||
raise Error::BadFormatRequest.new(response)
|
||||
elsif response.code == 502
|
||||
raise Error::BadGateway.new(response)
|
||||
raise Error::BadGateway.new(response)
|
||||
elsif response.code == 503
|
||||
raise Error::ServiceUnavailable.new(response)
|
||||
elsif response.timed_out?
|
||||
|
|
|
@ -6,7 +6,7 @@ class APIEntreprise::API::Error < ::StandardError
|
|||
msg = <<~TEXT
|
||||
url: #{uri.host}#{uri.path}
|
||||
HTTP error code: #{response.code}
|
||||
body: #{CGI.escape(response.body)}
|
||||
body: #{response.body}
|
||||
curl message: #{response.return_message}
|
||||
total time: #{response.total_time}
|
||||
connect time: #{response.connect_time}
|
||||
|
|
|
@ -24,6 +24,11 @@ if ENV.has_key?('REDIS_SIDEKIQ_SENTINELS')
|
|||
if ENV['SKIP_RELIABLE_FETCH'].blank?
|
||||
Sidekiq::ReliableFetch.setup_reliable_fetch!(config)
|
||||
end
|
||||
|
||||
config.capsule('api_entreprise') do |cap|
|
||||
cap.concurrency = 1
|
||||
cap.queues = ['api_entreprise']
|
||||
end
|
||||
end
|
||||
|
||||
Sidekiq.configure_client do |config|
|
||||
|
|
|
@ -57,5 +57,9 @@ if Rails.env.production? && SIDEKIQ_ENABLED
|
|||
class Cron::CronJob < ApplicationJob
|
||||
self.queue_adapter = :sidekiq
|
||||
end
|
||||
|
||||
class APIEntreprise::Job < ApplicationJob
|
||||
self.queue_adapter = :sidekiq
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue