From c2880c01750216869438eb6c2dd1a9890924876f Mon Sep 17 00:00:00 2001 From: blitzmann Date: Thu, 4 May 2017 19:19:29 -0400 Subject: [PATCH] Move queue and wait variables to __init__. Turns out threading.start() returns before the thread actually starts, so there were situations in which we would start the thread and immediately try to use it before run() happened. --- service/price.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/service/price.py b/service/price.py index 0775c758d..fdfe8ac2c 100644 --- a/service/price.py +++ b/service/price.py @@ -223,16 +223,11 @@ class PriceWorkerThread(threading.Thread): def __init__(self): threading.Thread.__init__(self) self.name = "PriceWorker" + self.queue = Queue.Queue() + self.wait = {} pyfalog.debug("Initialize PriceWorkerThread.") def run(self): - pyfalog.debug("Run start") - self.queue = Queue.Queue() - self.wait = {} - self.processUpdates() - pyfalog.debug("Run end") - - def processUpdates(self): queue = self.queue while True: # Grab our data