mirror of
https://github.com/clearml/clearml
synced 2025-04-22 15:25:22 +00:00
Add Task.__get_master_process_id
This commit is contained in:
parent
5ce5035541
commit
ba1b8c403b
@ -2170,6 +2170,15 @@ class Task(IdObjectBase, AccessMixin, SetupUploadMixin):
|
|||||||
return None
|
return None
|
||||||
return master_task_id[1]
|
return master_task_id[1]
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def __get_master_process_id(cls):
|
||||||
|
# type: () -> Optional[str]
|
||||||
|
master_task_id = PROC_MASTER_ID_ENV_VAR.get().split(':')
|
||||||
|
# we could not find a task ID, revert to old stub behaviour
|
||||||
|
if len(master_task_id) < 2 or not master_task_id[1]:
|
||||||
|
return None
|
||||||
|
return master_task_id[0]
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def __is_subprocess(cls):
|
def __is_subprocess(cls):
|
||||||
# type: () -> bool
|
# type: () -> bool
|
||||||
|
Loading…
Reference in New Issue
Block a user