sidekiq-failures
sidekiq-failures copied to clipboard
Sidekiq 7 boot troubles with failures_max_count unavailable.
trafficstars
This gem doesn't seem to work with sidekiq 7.
If you have set the failures_max_count options on an initializer:
Sidekiq.configure_server do |config|
config.failures_max_count = 5000
end
after upgrading to Sidekiq 7 on boot you get:
undefined method `failures_max_count=' for #<Sidekiq::Config:0x000056331ecfefe8>
api-sidekiq_1 | /app/config/initializers/sidekiq.rb:5:in `block in <main>'
api-sidekiq_1 | /bundle/ruby/2.7.0/gems/sidekiq-7.0.2/lib/sidekiq.rb:98:in `configure_server'
api-sidekiq_1 | /app/config/initializers/sidekiq.rb:3:in `<main>'
Hello @knightq
This is related to the following change in the config strategy of sidekiq 7: https://github.com/mperham/sidekiq/blob/main/docs/capsule.md#sidekiqconfig
If you set the config options of the sidekiq-failures gem outside sidekiq's configure_server block no exception is raised and the gem works as expected.
Instead of:
Sidekiq.configure_server do |config|
config.failures_max_count = 5000
end
You can do this:
Sidekiq.failures_max_count = 5000
Sidekiq.configure_server do |config|
# Other sidekiq config
end
This also fixed it for me. Thank you.
This fixed it for me too, thank you