From b68df56b14849b425c5e33767edfb792d159a765 Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Mon, 14 Sep 2015 09:35:55 -0400 Subject: [PATCH] use global db connection if configured --- poller-service.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/poller-service.py b/poller-service.py index 84f293648..c46d81a4d 100755 --- a/poller-service.py +++ b/poller-service.py @@ -266,8 +266,14 @@ def poll_worker(): global dev_query global devices_scanned global dont_query_until + global single_connection thread_id = threading.current_thread().name - db = DB() + + if single_connection: + global db + else: + db = DB() + while True: if datetime.now() < dont_query_until: time.sleep(1)