-
-
Notifications
You must be signed in to change notification settings - Fork 139
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 v7: fixes #152
Sidekiq v7: fixes #152
Conversation
9b59fb8
to
7bb88aa
Compare
7bb88aa
to
a6ab02c
Compare
if Sidekiq::LimitFetch.post_7? | ||
options.config[:fetch] = Sidekiq::LimitFetch | ||
capsule_or_options.config[:fetch_class] = Sidekiq::LimitFetch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I'm not wrong, starting from Sidekiq v7, the option to define a custom "fetcher" is fetch_class
, cf https://github.com/mperham/sidekiq/blob/4d3f90ba56dd9f9faa35a18bbdfb1b5cb726ee5c/lib/sidekiq/capsule.rb#L37
@@ -22,6 +22,10 @@ def post_7? | |||
@post_7 ||= Gem::Version.new(Sidekiq::VERSION) >= Gem::Version.new('7.0.0') | |||
end | |||
|
|||
def post_6_5? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method is moved to have it public (to be able to use it from tests)
if Sidekiq::LimitFetch.post_7? | ||
options = options.config | ||
end | ||
def start(capsule_or_options) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a renaming to make it clear that the argument maybe a Capsule
object or an options Hash, depending on the Sidekiq version
@@ -0,0 +1,17 @@ | |||
RSpec.describe Sidekiq::Manager do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added this test to have a better coverage (because this would have failed when upgrading to Sidekiq v7)
@rgaufman you might be interested by this one |
I actually downgraded to sidekiq6 for now but thank you, this is great! |
Thanks! 👍 |
I think there are some missing changes to have the gem compatible with Sidekiq v7. The main one is the change on the customization of the "fetching class": it's now
fetch_class
and notfetch
anymore (cf my GH comment).I recommend to use the "Hide whitespace option" when reviewing, because there is some indentation change in
spec/sidekiq/limit_fetch/global/monitor_spec.rb
file.