mirror of
https://github.com/clearml/clearml
synced 2025-03-03 10:42:00 +00:00
Add Task.stopped reason arg
This commit is contained in:
parent
371405cad9
commit
3b7fc2e0d2
@ -553,10 +553,13 @@ class Task(IdObjectBase, AccessMixin, SetupUploadMixin):
|
||||
""" The signal that this Task started. """
|
||||
return self.send(tasks.StartedRequest(self.id, force=force), ignore_errors=ignore_errors)
|
||||
|
||||
def stopped(self, ignore_errors=True, force=False):
|
||||
# type: (bool, bool) -> ()
|
||||
def stopped(self, ignore_errors=True, force=False, status_reason=None):
|
||||
# type: (bool, bool, Optional[str]) -> ()
|
||||
""" The signal that this Task stopped. """
|
||||
return self.send(tasks.StoppedRequest(self.id, force=force), ignore_errors=ignore_errors)
|
||||
return self.send(
|
||||
tasks.StoppedRequest(self.id, force=force, status_reason=status_reason),
|
||||
ignore_errors=ignore_errors
|
||||
)
|
||||
|
||||
def completed(self, ignore_errors=True):
|
||||
# type: (bool) -> ()
|
||||
|
@ -2883,7 +2883,7 @@ class Task(_Task):
|
||||
)
|
||||
)
|
||||
self.flush(wait_for_uploads=True)
|
||||
self.stopped()
|
||||
self.stopped(status_reason='USER ABORTED')
|
||||
|
||||
if self._dev_worker:
|
||||
self._dev_worker.unregister()
|
||||
|
Loading…
Reference in New Issue
Block a user