Sfoglia il codice sorgente

celeryd: Stop worker on SIGTERM

Ask Solem 15 anni fa
parent
commit
3ae14215d0
1 ha cambiato i file con 3 aggiunte e 0 eliminazioni
  1. 3 0
      celery/bin/celeryd.py

+ 3 - 0
celery/bin/celeryd.py

@@ -213,9 +213,12 @@ class Worker(object):
 def install_worker_term_handler(worker):
 
     def _stop(signum, frame):
+        worker.stop()
         raise SystemExit()
+
     platform.install_signal_handler("SIGTERM", _stop)
 
+
 def install_worker_restart_handler(worker):
 
     def restart_worker_sig_handler(signum, frame):