we want to wait for workers and not enqueued jobs

This commit is contained in:
Régis Hanol 2014-02-13 02:53:20 -08:00
parent d94774ceec
commit aff3463957
2 changed files with 4 additions and 2 deletions

View file

@ -101,7 +101,8 @@ module Export
def wait_for_sidekiq
log "Waiting for sidekiq to finish running jobs..."
iterations = 0
while (running = Sidekiq::Queue.all.map(&:size).sum) > 0
workers = Sidekiq::Workers.new
while (running = workers.size) > 0
log " Waiting for #{running} jobs..."
sleep 2
iterations += 1

View file

@ -128,7 +128,8 @@ module Import
def wait_for_sidekiq
log "Waiting for sidekiq to finish running jobs..."
iterations = 0
while (running = Sidekiq::Queue.all.map(&:size).sum) > 0
workers = Sidekiq::Workers.new
while (running = workers.size) > 0
log " Waiting for #{running} jobs..."
sleep 5
iterations += 1