Browse Source

celeryd: Stop worker on SIGTERM

Ask Solem 15 years ago
parent
commit
3ae14215d0
1 changed files with 3 additions and 0 deletions
  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):