Explorar o código

install_cry_handler now with argument to specify signal name

Ask Solem %!s(int64=12) %!d(string=hai) anos
pai
achega
9264e140fd
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      celery/apps/worker.py

+ 2 - 2
celery/apps/worker.py

@@ -287,7 +287,7 @@ def install_worker_restart_handler(worker, sig='SIGHUP'):
     platforms.signals[sig] = restart_worker_sig_handler
 
 
-def install_cry_handler():
+def install_cry_handler(sig='SIGUSR1'):
     # Jython/PyPy does not have sys._current_frames
     if is_jython or is_pypy:  # pragma: no cover
         return
@@ -296,7 +296,7 @@ def install_cry_handler():
         """Signal handler logging the stacktrace of all active threads."""
         with in_sighandler():
             safe_say(cry())
-    platforms.signals['SIGUSR1'] = cry_handler
+    platforms.signals[sig] = cry_handler
 
 
 def install_rdb_handler(envvar='CELERY_RDBSIG',