lib/rocket_job/supervisor.rb in rocketjob-5.3.1 vs lib/rocket_job/supervisor.rb in rocketjob-5.3.2
- old
+ new
@@ -53,10 +53,12 @@
logger.info("Shutdown Complete")
end
def stop!
server.stop! if server.may_stop?
- worker_pool.stop
+ synchronize do
+ worker_pool.stop
+ end
until worker_pool.join
logger.info "Waiting for workers to finish processing ..."
# One or more workers still running so update heartbeat so that server reports "alive".
server.refresh(worker_pool.living_count)
end