Fix when abort callback is set, set task status to stopped only if running locally, otherwise leave it for the Agent to set it.

This commit is contained in:
allegroai 2024-07-31 17:25:12 +03:00
parent b298e212dd
commit 62dd92a22d

View File

@ -4148,7 +4148,10 @@ class Task(_Task):
)
)
self.flush(wait_for_uploads=True)
self.stopped(status_reason='USER ABORTED')
# if running remotely, we want the daemon to kill us
if self.running_locally():
self.stopped(status_reason='USER ABORTED')
if self._dev_worker:
self._dev_worker.unregister()