lib/sidekiq/throttled/strategy/concurrency.rb in sidekiq-throttled-0.18.0 vs lib/sidekiq/throttled/strategy/concurrency.rb in sidekiq-throttled-1.0.0.alpha

- old
+ new

@@ -1,10 +1,10 @@ # frozen_string_literal: true require "redis_prescription" -require "sidekiq/throttled/strategy/base" +require_relative "./base" module Sidekiq module Throttled class Strategy # Concurrency throttling strategy @@ -47,12 +47,10 @@ return true if job_limit <= 0 keys = [key(job_args)] argv = [jid.to_s, job_limit, @ttl, Time.now.to_f] - Sidekiq.redis do |redis| - 1 == SCRIPT.call(redis, :keys => keys, :argv => argv) - end + Sidekiq.redis { |redis| 1 == SCRIPT.call(redis, keys: keys, argv: argv) } end # @return [Integer] Current count of jobs def count(*job_args) Sidekiq.redis { |conn| conn.zcard(key(job_args)) }.to_i