in lib/aws/active_job/sqs/executor.rb [51:69]
def shutdown(timeout = nil)
@shutting_down.make_true
run_hooks_for(:stop)
@executor.shutdown
clean_shutdown = @executor.wait_for_termination(timeout)
if clean_shutdown
@logger.info 'Clean shutdown complete. All executing jobs finished.'
else
@logger.info "Timeout (#{timeout}) exceeded. Some jobs may not have " \
'finished cleanly. Unfinished jobs will not be removed from ' \
'the queue and can be ru-run once their visibility timeout ' \
'passes.'
end
@error_queue.push(nil)
@error_handler_thread.join unless @error_handler_thread == Thread.current
@shutting_down.make_false
end