Fix Task.init(continue_last_task=0) ignored when running remotely

This commit is contained in:
allegroai 2023-04-19 15:05:26 +03:00
parent af04877a0e
commit 107bb93ab0

View File

@ -627,8 +627,10 @@ class Task(_Task):
cls.__update_master_pid_task(task=task)
# make sure we are started
task.started(ignore_errors=True)
# continue last iteration if we had any
if task.data.last_iteration:
# continue last iteration if we had any (or we need to override it)
if isinstance(continue_last_task, int) and not isinstance(continue_last_task, bool):
task.set_initial_iteration(int(continue_last_task))
elif task.data.last_iteration:
task.set_initial_iteration(int(task.data.last_iteration) + 1)
else:
# subprocess should get back the task info