-
Notifications
You must be signed in to change notification settings - Fork 236
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
Remove config get/set depication warning due to Sidekiq 6.5+ #385
Remove config get/set depication warning due to Sidekiq 6.5+ #385
Conversation
Sidekiq 6.5 and later changed how config options work. ```ruby # Before config.options[:x] = 1 config.options[:y] # => 2 # After config[:x] = 1 config[:y] # => 2 ``` The existing functionality works, but now throws a deprication warning and will most likely be removed for Sidekiq 7. There is also no non-depricated way to access the config hash. To maintain compatability with older Sidekiq versions, a `SIDEKIQ_GTE_6_5_0` has been added which is `true` if `Sidekiq::VERSION` is 6.5 or later. This constant is then used to determine now to pull the Sidekiq config hash and set configuration options where applicable.
I have a very basic Rails app with sidekiq 6.5 and this branch wired up to enqueue an ActiveJob and stright Sidekiq job every 5 minutes. https://github.com/t27duck/sidekiq_scheduler_384_test
The jobs enqueue and run as expected. Deprication warnings no longer showed up. 🤷♂️ |
What I find odd is the specs are using the now depricated setters/getters for the Sidekiq config but I didn't see any deprication warnings printed out? |
I've tried to remove the code inside |
@t27duck Thanks for the PR! I probably won't have time this week to look into it, but as soon as I have, I'll give you feedback! |
Looks good! 👍 |
That's due to the log level in specs be in ERROR mode https://github.com/moove-it/sidekiq-scheduler/blob/master/spec/support/initialization/logs.rb#L5 |
Co-authored-by: Olle Jonsson <olle.jonsson@gmail.com>
I'm concerned that Shouldn't 6.5+ initialize |
Specifically, the whole thing breaks down here https://github.com/moove-it/sidekiq-scheduler/blob/master/lib/sidekiq-scheduler/manager.rb#L40 Sidekiq 6.5+'s new config object only exposes hash-like setters and getters for its keys, but there's no way to get the entire key-value set of options. |
@bpo @t27duck I think that for now to just fix the warning using We definitely want to pass the config object but that means a large refactoring to the manager which probably will be incompatible with older versions of sidekiq and will require a major bump. |
I want to make some more tests tomorrow, if everything looks good I'll push a new release, thanks @t27duck! |
Closes #384
Sidekiq 6.5 and later changed how config options work.
The existing functionality works, but now throws a deprication warning and will most likely be removed for Sidekiq 7. There is also no non-depricated way to access the config hash.
To maintain compatability with older Sidekiq versions, a
SIDEKIQ_GTE_6_5_0
has been added which istrue
ifSidekiq::VERSION
is 6.5 or later. This constant is then used to determine now to pull the Sidekiq config hash and set configuration options where applicable.This should allow the gem to maintain compatability with Sidekiq < 6.5