MCPcopy
hub / github.com/celery/celery / abort

Method abort

celery/contrib/abortable.py:114–127  ·  view source on GitHub ↗

Set the state of the task to :const:`ABORTED`. Abortable tasks monitor their state at regular intervals and terminate execution if so. Warning: Be aware that invoking this method does not guarantee when the task will be aborted (or even if the task w

(self)

Source from the content-addressed store, hash-verified

112 return self.state == ABORTED
113
114 def abort(self):
115 """Set the state of the task to :const:`ABORTED`.
116
117 Abortable tasks monitor their state at regular intervals and
118 terminate execution if so.
119
120 Warning:
121 Be aware that invoking this method does not guarantee when the
122 task will be aborted (or even if the task will be aborted at all).
123 """
124 # TODO: store_result requires all four arguments to be set,
125 # but only state should be updated here
126 return self.backend.store_result(self.id, result=None,
127 state=ABORTED, traceback=None)
128
129
130class AbortableTask(Task):

Callers 2

exampleFunction · 0.80

Calls 1

store_resultMethod · 0.45

Tested by 1