MCPcopy
hub / github.com/celery/celery / stop

Method stop

celery/bootsteps.py:155–176  ·  view source on GitHub ↗
(self, parent, close=True, terminate=False)

Source from the content-addressed store, hash-verified

153 'Error on %s %s: %r', description, step.alias, exc)
154
155 def stop(self, parent, close=True, terminate=False):
156 what = 'terminating' if terminate else 'stopping'
157 if self.state in (CLOSE, TERMINATE):
158 return
159
160 if self.state != RUN or self.started != len(parent.steps):
161 # Not fully started, can safely exit.
162 self.state = TERMINATE
163 self.shutdown_complete.set()
164 return
165 self.close(parent)
166 self.state = CLOSE
167
168 self.restart(
169 parent, 'terminate' if terminate else 'stop',
170 description=what, propagate=False,
171 )
172
173 if self.on_stopped:
174 self.on_stopped()
175 self.state = TERMINATE
176 self.shutdown_complete.set()
177
178 def join(self, timeout=None):
179 try:

Callers 2

stopMethod · 0.45

Calls 4

closeMethod · 0.95
restartMethod · 0.95
on_stoppedMethod · 0.80
setMethod · 0.45

Tested by 1