This commit is contained in:
aozhiwei 2020-01-13 17:55:58 +08:00
parent ae2892cd49
commit 1d7840b984

View File

@ -99,7 +99,7 @@ class _App:
if msgid == _IM_DoneCallback:
self._IMDoneCallback(callback)
except Exception as e:
f7.udplog.error('_dispatchIMMsg ' + str(e))
f7.udplog.error('_dispatchIMMsg %d %s' % (msgid, str(e)))
def _addIMMsg(self, msgid, callback):
self._immsgLock.acquire()
@ -112,8 +112,12 @@ class _App:
callback()
def createAsyncTask(self, done_callback, func, *args):
assert self._listened
def thread_func(args):
func(args)
try:
func(args)
except Exception as e:
f7.udplog.error('_dispatchIMMsg ' + str(e))
if done_callback:
self._addIMMsg(_IM_DoneCallback, done_callback)
thread = threading.Thread(target = thread_func, args = args)