Skip to content

Commit

Permalink
refactor: Reduce arrays allocation
Browse files Browse the repository at this point in the history
  • Loading branch information
ixti committed Jan 16, 2024
1 parent 6294b2b commit bf88735
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/sidekiq/throttled/patches/basic_fetch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ def requeue_throttled(work)
# @param [Array<String>] queues
# @return [Array<String>]
def queues_cmd
super - (Throttled.cooldown&.queues || [])
throttled_queues = Throttled.cooldown&.queues
return super unless throttled_queues&.size&.positive?

super - throttled_queues
end
end
end
Expand Down

0 comments on commit bf88735

Please sign in to comment.