MCPcopy
hub / github.com/celery/celery / _handle_request

Function _handle_request

celery/apps/worker.py:301–314  ·  view source on GitHub ↗
(*args)

Source from the content-addressed store, hash-verified

299 verbose (bool, optional): Whether to print the type of shutdown. Defaults to True.
300 """
301 def _handle_request(*args):
302 with in_sighandler():
303 from celery.worker import state
304 if current_process()._name == 'MainProcess':
305 if callback:
306 callback(worker)
307 if verbose:
308 safe_say(f'worker: {how} shutdown (MainProcess)', sys.__stdout__)
309 signals.worker_shutting_down.send(
310 sender=worker.hostname, sig=sig, how=how,
311 exitcode=exitcode,
312 )
313 setattr(state, {'Warm': 'should_stop',
314 'Cold': 'should_terminate'}[how], exitcode)
315 _handle_request.__name__ = str(f'worker_{how}')
316 platforms.signals[sig] = _handle_request
317

Callers

nothing calls this directly

Calls 5

in_sighandlerFunction · 0.90
current_processFunction · 0.85
callbackFunction · 0.85
safe_sayFunction · 0.85
sendMethod · 0.45

Tested by

no test coverage detected