mirror of
https://github.com/clearml/clearml
synced 2025-02-07 21:33:25 +00:00
Improve docstring for Task.close and Task.mark_completed
This commit is contained in:
commit
aa69f45d3b
@ -680,12 +680,14 @@ class Task(IdObjectBase, AccessMixin, SetupUploadMixin):
|
||||
This is in contrast to :meth:`Task.close`, which does the first two steps, but does not terminate the running Python process.
|
||||
|
||||
For example, in
|
||||
```
|
||||
task.mark_completed()
|
||||
from time import sleep
|
||||
sleep(30)
|
||||
print('This text will not be printed!')
|
||||
```
|
||||
|
||||
.. code-block:: py
|
||||
|
||||
task.mark_completed()
|
||||
from time import sleep
|
||||
sleep(30)
|
||||
print('This text will not be printed!')
|
||||
|
||||
the text will not be printed, because the Python process is immediately terminated.
|
||||
|
||||
:param bool ignore_errors: If True default), ignore any errors raised
|
||||
|
@ -1725,10 +1725,10 @@ class Task(_Task):
|
||||
def close(self):
|
||||
"""
|
||||
Closes the current Task and changes its status to "Completed".
|
||||
Enables you to manually shutdown the task.
|
||||
Enables you to manually shut down the task.
|
||||
This method does not terminate the current Python process, in contrast to :meth:`Task.mark_completed`.
|
||||
|
||||
After having :meth:`Task.close`d a task, the respective object cannot be used anymore and
|
||||
After having :meth:`Task.close` -d a task, the respective object cannot be used anymore and
|
||||
methods like :meth:`Task.connect` or :meth:`Task.connect_configuration` will throw a `ValueError`.
|
||||
In order to obtain an object representing the task again, use methods like :meth:`Task.get_task`.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user