Skip to content

Commit

Permalink
Call kill directly b/c running will be false and won't make it there
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonhilkert committed Aug 12, 2017
1 parent b91bc22 commit 54433b8
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions lib/sucker_punch/queue.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ def self.stats
queues[queue.name] = {
"workers" => {
"total" => queue.total_workers,
"busy" => queue.busy_workers,
"idle" => queue.idle_workers,
"busy" => queue.busy_workers,
"idle" => queue.idle_workers,
},
"jobs" => {
"processed" => queue.processed_jobs,
"failed" => queue.failed_jobs,
"enqueued" => queue.enqueued_jobs,
"failed" => queue.failed_jobs,
"enqueued" => queue.enqueued_jobs,
}
}
end
Expand All @@ -70,7 +70,7 @@ def self.shutdown_all
if SuckerPunch::RUNNING.make_false

queues = all
latch = Concurrent::CountDownLatch.new(queues.length)
latch = Concurrent::CountDownLatch.new(queues.length)

queues.each do |queue|
queue.post(latch) { |l| l.count_down }
Expand Down Expand Up @@ -146,9 +146,7 @@ def post(*args, &block)
end

def kill
if can_initiate_shutdown?
@pool.kill
end
@pool.kill
end

def shutdown
Expand Down

0 comments on commit 54433b8

Please sign in to comment.