mirror of
https://github.com/clearml/clearml
synced 2025-01-31 09:07:00 +00:00
Orderly shutdown threads
This commit is contained in:
parent
433de0186c
commit
4ed33474fe
@ -925,13 +925,13 @@ class Task(_Task):
|
|||||||
self.log.info('Waiting to finish uploads')
|
self.log.info('Waiting to finish uploads')
|
||||||
print_done_waiting = True
|
print_done_waiting = True
|
||||||
# from here, do not send log in background thread
|
# from here, do not send log in background thread
|
||||||
self._logger.set_flush_period(None)
|
|
||||||
if wait_for_uploads:
|
if wait_for_uploads:
|
||||||
self.flush(wait_for_uploads=True)
|
self.flush(wait_for_uploads=True)
|
||||||
if print_done_waiting:
|
if print_done_waiting:
|
||||||
self.log.info('Finished uploading')
|
self.log.info('Finished uploading')
|
||||||
else:
|
else:
|
||||||
self._logger._flush_stdout_handler()
|
self._logger._flush_stdout_handler()
|
||||||
|
self._logger.set_flush_period(None)
|
||||||
# this is so in theory we can close a main task and start a new one
|
# this is so in theory we can close a main task and start a new one
|
||||||
Task.__main_task = None
|
Task.__main_task = None
|
||||||
except Exception:
|
except Exception:
|
||||||
|
Loading…
Reference in New Issue
Block a user