lib/sidekiq/limit_fetch/global/selector.rb in sidekiq-limit_fetch-1.6 vs lib/sidekiq/limit_fetch/global/selector.rb in sidekiq-limit_fetch-1.7

- old
+ new

@@ -58,11 +58,11 @@ local queue_locks local blocking_mode for _, queue in ipairs(queues) do if not blocking_mode or unblocked[queue] then - local busy_key = namespace..'busy:'..queue + local probed_key = namespace..'probed:'..queue local pause_key = namespace..'pause:'..queue local paused = redis.call('get', pause_key) if not paused then local limit_key = namespace..'limit:'..queue @@ -70,11 +70,11 @@ local block_key = namespace..'block:'..queue local can_block = redis.call('get', block_key) if can_block or queue_limit then - queue_locks = redis.call('llen', busy_key) + queue_locks = redis.call('llen', probed_key) end blocking_mode = can_block and queue_locks > 0 if blocking_mode and can_block ~= 'true' then @@ -82,11 +82,11 @@ unblocked[unblocked_queue] = true end end if not queue_limit or queue_limit > queue_locks then - redis.call('rpush', busy_key, worker_name) + redis.call('rpush', probed_key, worker_name) table.insert(available, queue) end end end end @@ -100,11 +100,11 @@ local namespace = table.remove(ARGV, 1)..'limit_fetch:' local worker_name = table.remove(ARGV, 1) local queues = ARGV for _, queue in ipairs(queues) do - local busy_key = namespace..'busy:'..queue - redis.call('lrem', busy_key, 1, worker_name) + local probed_key = namespace..'probed:'..queue + redis.call('lrem', probed_key, 1, worker_name) end LUA end end end