Skip to content

update Reject#kill_with_options? for Ruby 3 kwargs#868

Merged
mhenrixon merged 2 commits intomhenrixon:mainfrom
stathis-alexander:ajs/kill-with-opts
Mar 1, 2025
Merged

update Reject#kill_with_options? for Ruby 3 kwargs#868
mhenrixon merged 2 commits intomhenrixon:mainfrom
stathis-alexander:ajs/kill-with-opts

Conversation

@stathis-alexander
Copy link
Copy Markdown
Contributor

@stathis-alexander stathis-alexander commented Feb 28, 2025

Sometime in the past either the definition of arity or Sidekiq::Deadset#kill was changed. Currently https://apidock.com/ruby/Method/arity returns negative numbers when there are optional arguments, which this method does not consider. The current (and what's been the state for many years now) version of this method takes an optional hash / opts argument": https://github.com/sidekiq/sidekiq/blob/main/lib/sidekiq/api.rb#L900, so the current method is just always returning false.

My suspicion is that this changed around Ruby3 with the kwarg changes, but I'm not sure.

This updates the method to return true if it takes more than one required argument, whether there are optional args or not.

Comment thread lib/sidekiq_unique_jobs/on_conflict/reject.rb
@mhenrixon mhenrixon merged commit 6c00671 into mhenrixon:main Mar 1, 2025
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

Successfully merging this pull request may close these issues.

2 participants