Browse Source

Cosmetics

Ask Solem 13 years ago
parent
commit
a0ec8955cb
2 changed files with 12 additions and 13 deletions
  1. 12 12
      celery/apps/worker.py
  2. 0 1
      celery/tests/test_bin/test_celeryd.py

+ 12 - 12
celery/apps/worker.py

@@ -305,6 +305,18 @@ def install_worker_term_handler(worker):
     platforms.signals["SIGTERM"] = _stop
 
 
+def install_worker_term_hard_handler(worker):
+
+    def _stop(signum, frame):
+        process_name = get_process_name()
+        if not process_name or process_name == "MainProcess":
+            print("celeryd: Cold shutdown (%s)" % (process_name, ))
+            worker.terminate(in_sighandler=True)
+        raise SystemExit()
+
+    platforms.signals["SIGQUIT"] = _stop
+
+
 def install_worker_restart_handler(worker):
 
     def restart_worker_sig_handler(signum, frame):
@@ -347,15 +359,3 @@ def install_HUP_not_supported_handler(worker):
             "Restarting with HUP is unstable on this platform!")
 
     platforms.signals["SIGHUP"] = warn_on_HUP_handler
-
-
-def install_worker_term_hard_handler(worker):
-
-    def _stop(signum, frame):
-        process_name = get_process_name()
-        if not process_name or process_name == "MainProcess":
-            worker.logger.warning("celeryd: Cold shutdown (%s)" % (process_name, ))
-            worker.terminate(in_sighandler=True)
-        raise SystemExit()
-
-    platforms.signals["SIGQUIT"] = _stop

+ 0 - 1
celery/tests/test_bin/test_celeryd.py

@@ -568,7 +568,6 @@ class test_signal_handlers(AppCase):
         finally:
             os.execv = execv
 
-
     @disable_stdouts
     def test_worker_term_hard_handler(self):
         worker = self._Worker()