From 6c5f71bbb583990f753b6bc3a34ee479214caf71 Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Mon, 13 Jul 2015 10:06:57 -0400 Subject: [PATCH] remove queue locks on empty query --- poller-service.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/poller-service.py b/poller-service.py index e64c9800b..db20994f0 100755 --- a/poller-service.py +++ b/poller-service.py @@ -268,13 +268,12 @@ while True: t = threading.Thread(target=poll_worker, args=[device_id, action]) t.start() - # If there is only one device, release the queue lock, because it won't release automatically. - if len(devices) == 1: - releaseLock('queued.{}'.format(device_id)) - # If we made it this far, break out of the loop and query again. break # Looping with no break causes the service to be killed by init. # This point is only reached if the query is empty, so sleep half a second before querying again. time.sleep(.5) + + # Make sure we're not holding any device queue locks in this connection before querying again. + getLock('unlock.{}'.format(config['distributed_poller_name']))