mirror of
https://github.com/clearml/clearml
synced 2025-06-26 18:16:07 +00:00
Fix close task after logger is closed
This commit is contained in:
parent
4edec4b74a
commit
28b85028fe
@ -2954,6 +2954,11 @@ class Task(_Task):
|
||||
self._resource_monitor.stop()
|
||||
self._resource_monitor = None
|
||||
|
||||
if self._logger:
|
||||
self._logger.set_flush_period(None)
|
||||
# noinspection PyProtectedMember
|
||||
self._logger._close_stdout_handler(wait=wait_for_uploads or wait_for_std_log)
|
||||
|
||||
if not is_sub_process:
|
||||
# change task status
|
||||
if not task_status:
|
||||
@ -2965,11 +2970,6 @@ class Task(_Task):
|
||||
elif task_status[0] == 'stopped':
|
||||
self.stopped()
|
||||
|
||||
if self._logger:
|
||||
self._logger.set_flush_period(None)
|
||||
# noinspection PyProtectedMember
|
||||
self._logger._close_stdout_handler(wait=wait_for_uploads or wait_for_std_log)
|
||||
|
||||
# this is so in theory we can close a main task and start a new one
|
||||
if self.is_main_task():
|
||||
Task.__main_task = None
|
||||
|
Loading…
Reference in New Issue
Block a user