def warn_on_HUP_handler(signum, frame): set_in_sighandler(True) try: safe_say('{sig} not supported: Restarting with {sig} is ' 'unstable on this platform!'.format(sig=sig)) finally: set_in_sighandler(False)
def cry_handler(signum, frame): """Signal handler logging the stacktrace of all active threads.""" set_in_sighandler(True) try: safe_say(cry()) finally: set_in_sighandler(False)
def warn_on_HUP_handler(signum, frame): set_in_sighandler(True) try: safe_say("%(sig)s not supported: Restarting with %(sig)s is " "unstable on this platform!" % {"sig": sig}) finally: set_in_sighandler(False)
def warn_on_HUP_handler(signum, frame): set_in_sighandler(True) try: safe_say('%(sig)s not supported: Restarting with %(sig)s is ' 'unstable on this platform!' % {'sig': sig}) finally: set_in_sighandler(False)
def cry_handler(*args): """Signal handler logging the stacktrace of all active threads.""" set_in_sighandler(True) try: safe_say(cry()) finally: set_in_sighandler(False)
def warn_on_HUP_handler(*args): set_in_sighandler(True) try: safe_say('%(sig)s not supported: Restarting with %(sig)s is ' 'unstable on this platform!' % {'sig': sig}) finally: set_in_sighandler(False)
def restart_worker_sig_handler(*args): """Signal handler restarting the current python program.""" set_in_sighandler(True) safe_say('Restarting celeryd (%s)' % (' '.join(sys.argv), )) import atexit atexit.register(_clone_current_worker) from celery.worker import state state.should_stop = True
def rdb_handler(signum, frame): """Signal handler setting a rdb breakpoint at the current frame.""" set_in_sighandler(True) try: from celery.contrib import rdb rdb.set_trace(frame) finally: set_in_sighandler(False)
def restart_worker_sig_handler(*args): """Signal handler restarting the current python program.""" set_in_sighandler(True) safe_say('Restarting celery worker ({0})'.format(' '.join(sys.argv))) import atexit atexit.register(_reload_current_worker) from celery.worker import state state.should_stop = EX_OK
def restart_worker_sig_handler(signum, frame): """Signal handler restarting the current python program.""" set_in_sighandler(True) safe_say("Restarting celeryd (%s)" % (" ".join(sys.argv), )) pid = os.fork() if pid == 0: os.execv(sys.executable, [sys.executable] + sys.argv) from celery.worker import state state.should_stop = True
def restart_worker_sig_handler(signum, frame): """Signal handler restarting the current python program.""" set_in_sighandler(True) safe_say('Restarting celeryd (%s)' % (' '.join(sys.argv), )) pid = os.fork() if pid == 0: os.execv(sys.executable, [sys.executable] + sys.argv) from celery.worker import state state.should_stop = True
def _handle_request(signum, frame): set_in_sighandler(True) try: from celery.worker import state if current_process()._name == "MainProcess": if callback: callback(worker) safe_say("celeryd: %s shutdown (MainProcess)" % how) if how == "Warm": state.should_stop = True elif how == "Cold": state.should_terminate = True finally: set_in_sighandler(False)
def _handle_request(*args): set_in_sighandler(True) try: from celery.worker import state if current_process()._name == 'MainProcess': if callback: callback(worker) safe_say('celeryd: %s shutdown (MainProcess)' % how) if active_thread_count() > 1: setattr(state, {'Warm': 'should_stop', 'Cold': 'should_terminate'}[how], True) else: raise exc() finally: set_in_sighandler(False)
def _handle_request(signum, frame): set_in_sighandler(True) try: from celery.worker import state if current_process()._name == 'MainProcess': if callback: callback(worker) safe_say('celeryd: %s shutdown (MainProcess)' % how) if active_thread_count() > 1: setattr(state, {'Warm': 'should_stop', 'Cold': 'should_terminate'}[how], True) else: raise exc() finally: set_in_sighandler(False)
def _handle_request(*args): set_in_sighandler(True) try: from celery.worker import state if current_process()._name == "MainProcess": if callback: callback(worker) safe_say("celeryd: %s shutdown (MainProcess)" % how) if active_thread_count() > 1: setattr(state, {"Warm": "should_stop", "Cold": "should_terminate"}[how], True) else: raise exc() finally: set_in_sighandler(False)
def _handle_request(signum, frame): set_in_sighandler(True) try: from celery.worker import state if current_process()._name == "MainProcess": if callback: callback(worker) safe_say("celeryd: %s shutdown (MainProcess)" % how) if active_thread_count() > 1: setattr(state, {"Warm": "should_stop", "Cold": "should_terminate"}[how], True) else: raise exc() finally: set_in_sighandler(False)
def warn_on_HUP_handler(*args): set_in_sighandler(True) try: safe_say("%(sig)s not supported: Restarting with %(sig)s is " "unstable on this platform!" % {"sig": sig}) finally: set_in_sighandler(False)