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.
This commit is contained in:
blitzmann
2017-05-04 19:19:29 -04:00
parent 3d0a4b84d4
commit c2880c0175

View File

@@ -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