From d76e9e78891e73e77e21f8e477fd88db85695329 Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Wed, 9 Sep 2015 15:05:39 -0400 Subject: [PATCH] release queue locks --- poller-service.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/poller-service.py b/poller-service.py index fbf681c93c..b424041302 100755 --- a/poller-service.py +++ b/poller-service.py @@ -240,12 +240,13 @@ def poll_worker(thread_id): while True: dev_row = db.query(dev_query) if len(dev_row) < 1: - log.warning("WARNING: Thread {0} returned no devices from query".format(thread_id)) + #log.warning("WARNING: Thread {0} returned no devices from query".format(thread_id)) continue device_id, status, next_poll, next_discovery = dev_row[0] if not getLock('queue.{0}'.format(device_id), db): + releaseLock('queue.{0}'.format(device_id), db): continue if next_poll and next_poll > datetime.now(): @@ -263,9 +264,10 @@ def poll_worker(thread_id): if not getLock('{0}.{1}'.format(action, device_id), db): releaseLock('{0}.{1}'.format(action, device_id), db) + releaseLock('queue.{0}'.format(device_id), db): continue - releaseLock('{0}.{1}'.format(action, device_id), db) + releaseLock('queue.{0}'.format(device_id), db): try: start_time = time.time() path = poller_path