diff --git a/lib/export/exporter.rb b/lib/export/exporter.rb index 8d66e93b5..ef20eeb7e 100644 --- a/lib/export/exporter.rb +++ b/lib/export/exporter.rb @@ -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 diff --git a/lib/import/importer.rb b/lib/import/importer.rb index 91d010902..197a3afd2 100644 --- a/lib/import/importer.rb +++ b/lib/import/importer.rb @@ -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