Add Task._is_remote_main_task to support secondary copy of the main Task in remote run

This commit is contained in:
allegroai
2020-11-20 00:06:43 +02:00
parent 91cbc161f4
commit 21ef615bb1
3 changed files with 18 additions and 9 deletions

View File

@@ -1546,6 +1546,13 @@ class Task(IdObjectBase, AccessMixin, SetupUploadMixin):
self._app_server = Session.get_app_server_host()
return self._app_server
def _is_remote_main_task(self):
# type: () -> bool
"""
:return: return True if running remotely and this Task is the registered main task
"""
return running_remotely() and get_remote_task_id() == self.id
def _edit(self, **kwargs):
# type: (**Any) -> Any
with self._edit_lock: