diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2021-03-15 11:17:43 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-15 11:17:43 +0100 |
commit | e89e976e924f558d13893726b3edda7b428988fd (patch) | |
tree | 19d7c89ae751ec29c437c7617423f6b15c5b4618 /config/initializers | |
parent | 33198d8c0525df6ab364deae17610b774721e615 (diff) |
Fix configuration for sidekiq-unique-jobs after 7.x upgrade (#15908)
Remove locks from scheduled jobs
Diffstat (limited to 'config/initializers')
-rw-r--r-- | config/initializers/sidekiq.rb | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/config/initializers/sidekiq.rb b/config/initializers/sidekiq.rb index f2733562f..9d348ddd0 100644 --- a/config/initializers/sidekiq.rb +++ b/config/initializers/sidekiq.rb @@ -14,14 +14,30 @@ Sidekiq.configure_server do |config| chain.add SidekiqErrorHandler end - config.death_handlers << lambda do |job, _ex| - digest = job['lock_digest'] - SidekiqUniqueJobs::Digests.delete_by_digest(digest) if digest + config.server_middleware do |chain| + chain.add SidekiqUniqueJobs::Middleware::Server + end + + config.client_middleware do |chain| + chain.add SidekiqUniqueJobs::Middleware::Client end + + SidekiqUniqueJobs::Server.configure(config) end Sidekiq.configure_client do |config| config.redis = redis_params + + config.client_middleware do |chain| + chain.add SidekiqUniqueJobs::Middleware::Client + end end Sidekiq.logger.level = ::Logger.const_get(ENV.fetch('RAILS_LOG_LEVEL', 'info').upcase.to_s) + +SidekiqUniqueJobs.configure do |config| + config.reaper = :ruby + config.reaper_count = 1000 + config.reaper_interval = 600 + config.reaper_timeout = 150 +end |