|
...
|
...
|
@@ -8,6 +8,7 @@ import functools |
|
|
|
import logging
|
|
|
|
import threading
|
|
|
|
import time
|
|
|
|
import traceback
|
|
|
|
import uuid
|
|
|
|
from concurrent.futures import ThreadPoolExecutor
|
|
|
|
from threading import Timer
|
|
...
|
...
|
@@ -165,7 +166,8 @@ class Monitor(callback.CallBack): |
|
|
|
try:
|
|
|
|
res = func(**kwargs)
|
|
|
|
except BaseException as err:
|
|
|
|
self._task_(func.__name__, client, taskid, code=TaskStatus.EXCEPTION, msg={'error': repr(err)})
|
|
|
|
self._task_(func.__name__, client, taskid, code=TaskStatus.FAILED,
|
|
|
|
msg={'error': repr(err), 'full_error': traceback.format_exc()})
|
|
|
|
else:
|
|
|
|
self._task_(func.__name__, client, taskid, code=TaskStatus.SUCCESS, msg=res)
|
|
|
|
|
|
...
|
...
|
@@ -187,6 +189,7 @@ class Monitor(callback.CallBack): |
|
|
|
else:
|
|
|
|
try:
|
|
|
|
client = self._get_member(target)
|
|
|
|
assert hasattr(client, 'extend'), '帐号未登录'
|
|
|
|
if hasattr(client.extend, type_):
|
|
|
|
func = getattr(client.extend, type_)
|
|
|
|
else:
|
|
...
|
...
|
@@ -195,4 +198,4 @@ class Monitor(callback.CallBack): |
|
|
|
kwargs = parameter.join(func, payload)
|
|
|
|
self.executor.submit(self.thread, client, taskid, kwargs)
|
|
|
|
except BaseException as err:
|
|
|
|
self._socket.send({'error': repr(err)}) |
|
|
|
self._task_(type_, Munch(email=target), taskid, code=TaskStatus.EXCEPTION, msg={'error': repr(err)}) |
...
|
...
|
|