More fixes for the queue clean up

Changed that we call stop_listener and not _cleanup on exit
Then call _cleanup from the stop listener
We only need that if we have listeners (queue) anyway
This commit is contained in:
Clemens Schwaighofer
2025-08-05 13:22:54 +09:00
parent a7a4141f58
commit 60db747d6d
2 changed files with 3 additions and 2 deletions

View File

@@ -644,7 +644,7 @@ class Log(LogParent):
if log_queue is None:
return
self.log_queue = log_queue
atexit.register(self._cleanup)
atexit.register(self.stop_listener)
self.listener = logging.handlers.QueueListener(
self.log_queue,
*self.handlers.values(),
@@ -659,6 +659,7 @@ class Log(LogParent):
if self.listener is not None:
self.flush()
self.listener.stop()
self._cleanup()
# MARK: init main log
def __init_log(self, log_name: str) -> None: