summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2
diff options
context:
space:
mode:
authorTim Laszlo <tim.laszlo@gmail.com>2012-06-14 11:07:22 -0500
committerTim Laszlo <tim.laszlo@gmail.com>2012-06-14 11:07:22 -0500
commitd0555789f2af89817b4bf50a4d88e98ad6c20730 (patch)
treec02c89ee87b5bb6e0680cebb5602cc79f3d590b8 /src/lib/Bcfg2
parentde0f5b03c6afef195fc448b1ac4b0e1c216beed6 (diff)
downloadbcfg2-d0555789f2af89817b4bf50a4d88e98ad6c20730.tar.gz
bcfg2-d0555789f2af89817b4bf50a4d88e98ad6c20730.tar.bz2
bcfg2-d0555789f2af89817b4bf50a4d88e98ad6c20730.zip
DBStats: watch for missing work queue
Diffstat (limited to 'src/lib/Bcfg2')
-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):