(worker, sig='SIGHUP')
| 474 | |
| 475 | |
| 476 | def 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 | |
| 490 | def install_cry_handler(sig='SIGUSR1'): |
no outgoing calls
no test coverage detected