From 11db3c5b201f9c6780aebf1b1457bd63f59b222e Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Wed, 29 Nov 2023 16:13:07 -0500 Subject: [PATCH] Fix ordering during termination --- daemon-common/log.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/daemon-common/log.py b/daemon-common/log.py index 7bb01e49..2fc69956 100644 --- a/daemon-common/log.py +++ b/daemon-common/log.py @@ -97,8 +97,6 @@ class Logger(object): # Provide a termination function so all messages are flushed before terminating the main daemon def terminate(self): - if self.config["file_logging"]: - self.writer.close() if self.config["zookeeper_logging"]: self.out("Waiting for Zookeeper message queue to drain", state="s") @@ -112,6 +110,9 @@ class Logger(object): self.zookeeper_logger.stop() self.zookeeper_logger.join() + if self.config["file_logging"]: + self.writer.close() + # Output function def out(self, message, state=None, prefix=""): # Get the date