summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/lib/Bcfg2/Server/Plugin.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/Bcfg2/Server/Plugin.py b/src/lib/Bcfg2/Server/Plugin.py
index 2c636721c..8a193dfab 100644
--- a/src/lib/Bcfg2/Server/Plugin.py
+++ b/src/lib/Bcfg2/Server/Plugin.py
@@ -284,7 +284,7 @@ class ThreadedStatistics(Statistics,
def run(self):
if not self.load():
return
- while not self.terminate.isSet():
+ while not self.terminate.isSet() and self.work_queue != None:
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 not self.work_queue.empty():
+ if self.work_queue != None and not self.work_queue.empty():
self.save()
def process_statistics(self, metadata, data):