From 5dba50f1db4b9807a137a2f40b338010eaf297ea Mon Sep 17 00:00:00 2001 From: Tim Laszlo Date: Thu, 14 Jun 2012 18:17:15 -0500 Subject: ThreadedStatistics: Set daemon=False for ThreadedStatistic Revert d0555789f2af89817b4bf50a4d88e98ad6c20730 Set daemon=False for ThreadedStatistics. Resolves an issue where the thread is left running after the interpreter has shutdown. --- src/lib/Bcfg2/Server/Plugin.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/lib/Bcfg2/Server/Plugin.py') diff --git a/src/lib/Bcfg2/Server/Plugin.py b/src/lib/Bcfg2/Server/Plugin.py index 8a193dfab..a68a9e80e 100644 --- a/src/lib/Bcfg2/Server/Plugin.py +++ b/src/lib/Bcfg2/Server/Plugin.py @@ -212,7 +212,7 @@ class ThreadedStatistics(Statistics, self.terminate = core.terminate self.work_queue = Queue(100000) self.pending_file = "%s/etc/%s.pending" % (datastore, self.__class__.__name__) - self.daemon = True + self.daemon = False self.start() def save(self): @@ -284,7 +284,7 @@ class ThreadedStatistics(Statistics, def run(self): if not self.load(): return - while not self.terminate.isSet() and self.work_queue != None: + while not self.terminate.isSet(): try: (xdata, client) = self.work_queue.get(block=True, timeout=2) except Empty: @@ -294,7 +294,7 @@ class ThreadedStatistics(Statistics, self.logger.error("ThreadedStatistics: %s" % e) continue self.handle_statistic(xdata, client) - if self.work_queue != None and not self.work_queue.empty(): + if not self.work_queue.empty(): self.save() def process_statistics(self, metadata, data): -- cgit v1.2.3-1-g7c22