Skip to content

Commit 1fa03b9

Browse files
committed
bump gem version and fix bug where divide by zero occurs when therer are no queues
1 parent 17bddf0 commit 1fa03b9

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

lib/resque/plugins/round_robin/round_robin.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ def rotated_queues
1010
@n ||= 0
1111
@n += 1
1212
rot_queues = queues
13-
rot_queues.rotate(@n % rot_queues.size)
13+
if rot_queues.size > 0
14+
rot_queues.rotate(@n % rot_queues.size)
15+
else
16+
rot_queues
17+
end
1418
end
1519

1620
def reserve_with_round_robin
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module Resque
22
module Plugins
33
module RoundRobin
4-
VERSION = "0.0.1"
4+
VERSION = "0.0.2"
55
end
66
end
77
end

0 commit comments

Comments
 (0)