File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ def pop(non_block = false)
4545 else
4646 queue_names = @queues . map { |queue | queue . redis_name }
4747 synchronize do
48- value = @pool . with_connection { |pool | pool . blpop ( *( queue_names + [ 1 ] ) ) } until value
48+ value = @pool . with_connection { |pool | pool . blpop ( *( queue_names + [ :timeout => 1 ] ) ) } until value
4949 queue_name , payload = value
5050 queue = @queue_hash [ queue_name ]
5151 [ queue , queue . decode ( payload ) ]
@@ -59,7 +59,7 @@ def pop(non_block = false)
5959 # the timeout expires.
6060 def poll ( timeout )
6161 queue_names = @queues . map { |queue | queue . redis_name }
62- queue_name , payload = @pool . with_connection { |pool | pool . blpop ( *( queue_names + [ timeout ] ) ) }
62+ queue_name , payload = @pool . with_connection { |pool | pool . blpop ( *( queue_names + [ :timeout => timeout ] ) ) }
6363 return unless payload
6464
6565 synchronize do
Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ def pop non_block = false
7373 raise ThreadError unless value
7474 synchronize { decode value }
7575 else
76- value = @pool . with_connection { |pool | pool . blpop ( @redis_name , 1 ) } until value
76+ value = @pool . with_connection { |pool | pool . blpop ( @redis_name , :timeout => 1 ) } until value
7777 synchronize { decode value . last }
7878 end
7979 end
@@ -83,7 +83,7 @@ def pop non_block = false
8383 # Blocks for +timeout+ seconds if the queue is empty, and returns nil if
8484 # the timeout expires.
8585 def poll ( timeout )
86- queue_name , payload = @pool . with_connection { |pool | pool . blpop ( @redis_name , timeout ) }
86+ queue_name , payload = @pool . with_connection { |pool | pool . blpop ( @redis_name , :timeout => timeout ) }
8787 return unless payload
8888
8989 synchronize do
You can’t perform that action at this time.
0 commit comments