lib/rocket_job/server.rb in rocketjob-3.0.0 vs lib/rocket_job/server.rb in rocketjob-3.0.1
- old
+ new
@@ -269,10 +269,10 @@
rescue Exception => exc
logger.error('RocketJob::Server is stopping due to an exception', exc)
ensure
# Logs the backtrace for each running worker
if SemanticLogger::VERSION.to_i >= 4
- workers.each { |worker| logger.backtrace(thread: worker.thread) }
+ workers.each { |worker| logger.backtrace(thread: worker.thread) if worker.thread && worker.alive? }
end
end
def run_workers
stagger = true