mirror of
https://github.com/discourse/discourse.git
synced 2025-06-06 13:06:56 +08:00
FIX: Don't try to dequeue an empty queue.
This commit is contained in:
@ -62,6 +62,7 @@ module Scheduler
|
|||||||
|
|
||||||
# using non_block to match Ruby #deq
|
# using non_block to match Ruby #deq
|
||||||
def do_work(non_block = false)
|
def do_work(non_block = false)
|
||||||
|
return unless @queue.size > 0
|
||||||
db, job, desc = @queue.deq(non_block)
|
db, job, desc = @queue.deq(non_block)
|
||||||
db ||= RailsMultisite::ConnectionManagement::DEFAULT
|
db ||= RailsMultisite::ConnectionManagement::DEFAULT
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user