diff options
| author | Teddy Wing | 2018-01-08 16:13:37 +0100 | 
|---|---|---|
| committer | Teddy Wing | 2018-01-08 18:06:39 +0100 | 
| commit | 3487ce6f34ef187a2a8daf170440f51f659c46b7 (patch) | |
| tree | f58b893b2b8ab25bada62cd27a0087958cee489e /config/initializers | |
| parent | ea62637e47b08496edabb0cca6c9b05542872bb0 (diff) | |
| download | chouette-core-3487ce6f34ef187a2a8daf170440f51f659c46b7.tar.bz2 | |
initializers/sidekiq: Disable retries on Sidekiq jobs
Alban recommended disabling retries on all Sidekiq jobs. In theory, none
of our jobs should be automatically retried (except maybe the
Reflex/Codifligne sync tasks).
Another way of doing this also exists
(https://stackoverflow.com/questions/28412913/disable-automatic-retry-with-activejob-used-with-sidekiq/28427385#28427385),
but this appeared to work, looking at the job's JSON parameters in the
Sidekiq console.
This came about because a timeout from Faraday caused a
`WorkbenchImport` job to fail and presumably get retried by Sidekiq. The
retry caused a second, duplicate `Referential` to be created.
Refs #5495
Diffstat (limited to 'config/initializers')
| -rw-r--r-- | config/initializers/sidekiq.rb | 2 | 
1 files changed, 2 insertions, 0 deletions
| diff --git a/config/initializers/sidekiq.rb b/config/initializers/sidekiq.rb index c2d5f9d6d..1e9383c22 100644 --- a/config/initializers/sidekiq.rb +++ b/config/initializers/sidekiq.rb @@ -18,3 +18,5 @@ unless Rails.env.test? || Rails.env.development?      config.redis = { url: ENV.fetch('SIDEKIQ_REDIS_URL', 'redis://redis:6379/12') }    end  end + +Sidekiq.default_worker_options = { retry: false } | 
