Skip to content

Commit 7782bf4

Browse files
committed
only round-robin when there is a wildcard queue
1 parent 62b48dc commit 7782bf4

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

lib/resque/plugins/round_robin/round_robin.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,16 @@ def should_work_on_queue? queuename
5252
false
5353
end
5454

55+
# if any of our queues are wildcarded, then we want to round robin among them
56+
def should_round_robin?
57+
return @srr unless @srr.nil?
58+
@srr = @queues.include? '*'
59+
end
60+
5561
def reserve_with_round_robin
62+
if not should_round_robin?
63+
return reserve_without_round_robin
64+
end
5665

5766
qs = rotated_queues
5867
qs.each do |queue|

0 commit comments

Comments
 (0)