mirror of
https://github.com/clearml/clearml
synced 2025-02-12 07:35:08 +00:00
Fix CLEARML_DEFERRED_TASK_INIT=1
doesn't work
This commit is contained in:
parent
d9497dd603
commit
1729b9019f
@ -492,7 +492,8 @@ class Task(_Task):
|
|||||||
)
|
)
|
||||||
|
|
||||||
# if deferred_init==0 this means this is the nested call that actually generates the Task.init
|
# if deferred_init==0 this means this is the nested call that actually generates the Task.init
|
||||||
if cls.__main_task is not None and deferred_init != 0:
|
# notice isinstance(False, int) is always True, so we have to check type (we wanted deferred_init != 0)
|
||||||
|
if cls.__main_task is not None and (not (type(deferred_init) == int and deferred_init == 0)):
|
||||||
# if this is a subprocess, regardless of what the init was called for,
|
# if this is a subprocess, regardless of what the init was called for,
|
||||||
# we have to fix the main task hooks and stdout bindings
|
# we have to fix the main task hooks and stdout bindings
|
||||||
if cls.__forked_proc_main_pid != os.getpid() and cls.__is_subprocess():
|
if cls.__forked_proc_main_pid != os.getpid() and cls.__is_subprocess():
|
||||||
@ -560,7 +561,8 @@ class Task(_Task):
|
|||||||
if not running_remotely():
|
if not running_remotely():
|
||||||
# only allow if running locally and creating the first Task
|
# only allow if running locally and creating the first Task
|
||||||
# otherwise we ignore and perform in order
|
# otherwise we ignore and perform in order
|
||||||
if deferred_init != 0 and ENV_DEFERRED_TASK_INIT.get():
|
# notice isinstance(False, int) is always True, so we have to check type (we wanted deferred_init != 0)
|
||||||
|
if (not (type(deferred_init) == int and deferred_init == 0)) and ENV_DEFERRED_TASK_INIT.get():
|
||||||
deferred_init = True
|
deferred_init = True
|
||||||
if not is_sub_process_task_id and deferred_init:
|
if not is_sub_process_task_id and deferred_init:
|
||||||
def completed_cb(x):
|
def completed_cb(x):
|
||||||
|
Loading…
Reference in New Issue
Block a user