FIX: Don't try to dequeue an empty queue.

This commit is contained in:
Guo Xiang Tan 2018-06-19 15:25:44 +08:00
parent b8e5989201
commit 1af7d4a894
1 changed files with 1 additions and 0 deletions

View File

@ -62,6 +62,7 @@ module Scheduler
# using non_block to match Ruby #deq
def do_work(non_block = false)
return unless @queue.size > 0
db, job, desc = @queue.deq(non_block)
db ||= RailsMultisite::ConnectionManagement::DEFAULT