Add a try:except:finally block in the market price fetching thread
This commit is contained in:
2
eos
2
eos
Submodule eos updated: c513ac0322...7c9a59ca2a
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user