Add a try:except:finally block in the market price fetching thread

This commit is contained in:
cncfanatics
2010-10-19 08:23:01 +02:00
parent c16caac1ea
commit 5c653c98ae
2 changed files with 12 additions and 8 deletions

2
eos

Submodule eos updated: c513ac0322...7c9a59ca2a

View File

@@ -32,15 +32,19 @@ class PriceWorkerThread(threading.Thread):
def processUpdates(self):
queue = self.queue
while True:
# Grab our data and rerelease the lock
callback, requests = queue.get()
try:
# Grab our data and rerelease the lock
callback, requests = queue.get()
# Grab prices, this is the time-consuming part
if len(requests) > 0:
eos.types.Price.fetchPrices(*requests)
# Grab prices, this is the time-consuming part
if len(requests) > 0:
eos.types.Price.fetchPrices(*requests)
wx.CallAfter(callback)
queue.task_done()
wx.CallAfter(callback)
except:
pass
finally:
queue.task_done()
def trigger(self, prices, callbacks):
self.queue.put((callbacks, prices))