Skip to content

Commit

Permalink
Merge pull request #115 from nepalez/master
Browse files Browse the repository at this point in the history
Fix compatibility issue for sidekiq v6.1.0+
  • Loading branch information
Ravil Bayramgalin committed Mar 21, 2021
2 parents 1207ba9 + 96f2bec commit bf9cee3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/sidekiq/limit_fetch.rb
Expand Up @@ -26,8 +26,14 @@ def retrieve_work
UnitOfWork.new(queue, job) if job
end

# Backwards compatibility for sidekiq v6.1.0
# @see https://github.com/mperham/sidekiq/pull/4602
def bulk_requeue(*args)
Sidekiq::BasicFetch.bulk_requeue(*args)
if Sidekiq::BasicFetch.respond_to?(:bulk_requeue) # < 6.1.0
Sidekiq::BasicFetch.bulk_requeue(*args)
else # 6.1.0+
Sidekiq::BasicFetch.new(Sidekiq.options).bulk_requeue(*args)
end
end

def redis_retryable
Expand Down

0 comments on commit bf9cee3

Please sign in to comment.