From 4ed33474fe0104ecdce042d588d1eed42d566ad6 Mon Sep 17 00:00:00 2001 From: allegroai <> Date: Fri, 14 Jun 2019 01:04:42 +0300 Subject: [PATCH] Orderly shutdown threads --- trains/task.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/trains/task.py b/trains/task.py index f460f329..727b1201 100644 --- a/trains/task.py +++ b/trains/task.py @@ -925,13 +925,13 @@ class Task(_Task): self.log.info('Waiting to finish uploads') print_done_waiting = True # from here, do not send log in background thread - self._logger.set_flush_period(None) if wait_for_uploads: self.flush(wait_for_uploads=True) if print_done_waiting: self.log.info('Finished uploading') else: 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 Task.__main_task = None except Exception: