mirror of
https://github.com/clearml/clearml
synced 2025-06-26 18:16:07 +00:00
Fix Task.reset force not used
This commit is contained in:
parent
9624f2c715
commit
ab1c6ec0ca
@ -536,14 +536,15 @@ class Task(IdObjectBase, AccessMixin, SetupUploadMixin):
|
|||||||
res = self.send(tasks.GetByIdRequest(task=self.id))
|
res = self.send(tasks.GetByIdRequest(task=self.id))
|
||||||
return res.response.task
|
return res.response.task
|
||||||
|
|
||||||
def reset(self, set_started_on_success=True):
|
def reset(self, set_started_on_success=True, force=False):
|
||||||
# type: (bool) -> ()
|
# type: (bool, bool) -> ()
|
||||||
"""
|
"""
|
||||||
Reset the task. Task will be reloaded following a successful reset.
|
Reset the task. Task will be reloaded following a successful reset.
|
||||||
|
|
||||||
:param set_started_on_success: If True automatically set Task status to started after resetting it.
|
:param set_started_on_success: If True automatically set Task status to started after resetting it.
|
||||||
|
:param force: If not true, call fails if the task status is 'completed'
|
||||||
"""
|
"""
|
||||||
self.send(tasks.ResetRequest(task=self.id))
|
self.send(tasks.ResetRequest(task=self.id, force=force))
|
||||||
if set_started_on_success:
|
if set_started_on_success:
|
||||||
self.started()
|
self.started()
|
||||||
elif self._data:
|
elif self._data:
|
||||||
|
@ -1509,7 +1509,7 @@ class Task(_Task):
|
|||||||
- ``False`` - Do not force (default)
|
- ``False`` - Do not force (default)
|
||||||
"""
|
"""
|
||||||
if not running_remotely() or not self.is_main_task() or force:
|
if not running_remotely() or not self.is_main_task() or force:
|
||||||
super(Task, self).reset(set_started_on_success=set_started_on_success)
|
super(Task, self).reset(set_started_on_success=set_started_on_success, force=force)
|
||||||
|
|
||||||
def close(self):
|
def close(self):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user