Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sidekiq 7 boot troubles with failures_max_count unavailable. #146

Open
knightq opened this issue Dec 16, 2022 · 3 comments
Open

Sidekiq 7 boot troubles with failures_max_count unavailable. #146

knightq opened this issue Dec 16, 2022 · 3 comments

Comments

@knightq
Copy link

knightq commented Dec 16, 2022

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>'
@severinkaelin
Copy link

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

@scarroll32
Copy link

This also fixed it for me. Thank you.

@chrishough
Copy link

This fixed it for me too, thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants