MCPcopy
hub / github.com/celery/celery / install_worker_restart_handler

Function install_worker_restart_handler

celery/apps/worker.py:476–487  ·  view source on GitHub ↗
(worker, sig='SIGHUP')

Source from the content-addressed store, hash-verified

474
475
476def install_worker_restart_handler(worker, sig='SIGHUP'):
477
478 def restart_worker_sig_handler(*args):
479 """Signal handler restarting the current python program."""
480 set_in_sighandler(True)
481 safe_say(f"Restarting celery worker ({' '.join(sys.argv)})",
482 sys.__stdout__)
483 import atexit
484 atexit.register(_reload_current_worker)
485 from celery.worker import state
486 state.should_stop = EX_OK
487 platforms.signals[sig] = restart_worker_sig_handler
488
489
490def install_cry_handler(sig='SIGUSR1'):

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected