From 1d22f26bbef8f0b72ba8f0a075a99709831cdb92 Mon Sep 17 00:00:00 2001 From: Tim Laszlo Date: Wed, 16 Jun 2010 15:45:13 +0000 Subject: Reduce select timeouts to 2s git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5942 ce84e21b-d406-0410-9b95-82705330c041 --- src/lib/Server/Core.py | 4 ++-- src/lib/Server/Plugin.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/Server/Core.py b/src/lib/Server/Core.py index d08782ff6..f139ef99b 100644 --- a/src/lib/Server/Core.py +++ b/src/lib/Server/Core.py @@ -117,10 +117,10 @@ class Core(Component): while not terminate.isSet(): try: if famfd: - select.select([famfd], [], [], 15) + select.select([famfd], [], [], 2) else: if not self.fam.pending(): - time.sleep(15) + terminate.wait(15) self.fam.handle_event_set(self.lock) except: continue diff --git a/src/lib/Server/Plugin.py b/src/lib/Server/Plugin.py index 732d291b1..3558fcd9e 100644 --- a/src/lib/Server/Plugin.py +++ b/src/lib/Server/Plugin.py @@ -226,7 +226,7 @@ class ThreadedStatistics(Statistics, return while not self.terminate.isSet(): try: - (xdata, client) = self.work_queue.get(block=True, timeout=5) + (xdata, client) = self.work_queue.get(block=True, timeout=2) except Queue.Empty: continue except Exception, e: -- cgit v1.2.3-1-g7c22