enova / sidekiq-rate-limiter

Redis-backed, per-worker rate limits for job processing.
http://rubygems.org/gems/sidekiq-rate-limiter
MIT License
193 stars 43 forks source link

Fix for compatibility with sidekiq >= 6.1.0 #39

Closed anero closed 2 years ago

anero commented 4 years ago

A refactoring in the internal Fetch API was introduced in Sidekiq 6.1.0 that is not backwards compatible.

As part of this refactoring the object in the :fetch option is expected to be an instance of Sidekiq::BasicFetch or an object that responds to the same methods instead of a Class as it used to be.

This change allows using the gem with newer versions while keeping compatibility with old ones. See mperham/sidekiq#4602 for more details.

Fixes https://github.com/enova/sidekiq-rate-limiter/issues/38.

coveralls commented 4 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling 391f00c5fef9d5d366b822ea66e34230474cf657 on controlshift:upstream_fix_for_sidekiq_6_1_0 into 3e8bc81782a448b5f731a5559812bbc580ee74ea on enova:master.

coveralls commented 4 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling 391f00c5fef9d5d366b822ea66e34230474cf657 on controlshift:upstream_fix_for_sidekiq_6_1_0 into 3e8bc81782a448b5f731a5559812bbc580ee74ea on enova:master.

Empact commented 3 years ago

This would be a welcome change, currently fails with: "ERROR: Error fetching job: undefined method `retrieve_work' for Sidekiq::RateLimiter::Fetch:Class"

chriszo111 commented 3 years ago

Necessary to enable using sidekiq-pro >= 5.2.0 which depends on sidekiq >= 6.1.0 as there was a memory leak in sidekiq-pro

anero commented 2 years ago

Closing, superceded by https://github.com/enova/sidekiq-rate-limiter/pull/42