MCPcopy Create free account
hub / github.com/celery/celery / stop

Method stop

celery/worker/worker.py:312–320  ·  view source on GitHub ↗

Graceful shutdown of the worker server (Warm shutdown).

(self, in_sighandler=False, exitcode=None)

Source from the content-addressed store, hash-verified

310 not self.app.IS_WINDOWS)
311
312 def stop(self, in_sighandler=False, exitcode=None):
313 """Graceful shutdown of the worker server (Warm shutdown)."""
314 if exitcode is not None:
315 self.exitcode = exitcode
316 if self.blueprint.state == RUN:
317 self.signal_consumer_close()
318 if not in_sighandler or self.pool.signal_safe:
319 self._shutdown(warm=True)
320 self._send_worker_shutdown()
321
322 def terminate(self, in_sighandler=False):
323 """Not so graceful shutdown of the worker server (Cold shutdown)."""

Callers 4

startMethod · 0.95
on_stoppedMethod · 0.45
_shutdownMethod · 0.45

Calls 3

signal_consumer_closeMethod · 0.95
_shutdownMethod · 0.95
_send_worker_shutdownMethod · 0.95

Tested by 1