|
@@ -97,6 +97,7 @@ class WechatMPChannel(ChatChannel):
|
|
|
if self.passive_reply:
|
|
if self.passive_reply:
|
|
|
receiver = context["receiver"]
|
|
receiver = context["receiver"]
|
|
|
self.cache_dict[receiver] = reply.content
|
|
self.cache_dict[receiver] = reply.content
|
|
|
|
|
+ self.running.remove(receiver)
|
|
|
logger.info("[send] reply to {} saved to cache: {}".format(receiver, reply))
|
|
logger.info("[send] reply to {} saved to cache: {}".format(receiver, reply))
|
|
|
else:
|
|
else:
|
|
|
receiver = context["receiver"]
|
|
receiver = context["receiver"]
|
|
@@ -114,12 +115,10 @@ class WechatMPChannel(ChatChannel):
|
|
|
logger.info("[send] Do send to {}: {}".format(receiver, reply_text))
|
|
logger.info("[send] Do send to {}: {}".format(receiver, reply_text))
|
|
|
return
|
|
return
|
|
|
|
|
|
|
|
- def _success_callback(self, session_id, **kwargs): # 线程正常结束时的回调函数
|
|
|
|
|
- self.running.remove(session_id)
|
|
|
|
|
|
|
|
|
|
def _fail_callback(self, session_id, exception, context, **kwargs): # 线程异常结束时的回调函数
|
|
def _fail_callback(self, session_id, exception, context, **kwargs): # 线程异常结束时的回调函数
|
|
|
logger.exception("[wechatmp] Fail to generation message to user, msgId={}, exception={}".format(context['msg'].msg_id, exception))
|
|
logger.exception("[wechatmp] Fail to generation message to user, msgId={}, exception={}".format(context['msg'].msg_id, exception))
|
|
|
if self.passive_reply:
|
|
if self.passive_reply:
|
|
|
assert session_id not in self.cache_dict
|
|
assert session_id not in self.cache_dict
|
|
|
- self.running.remove(session_id)
|
|
|
|
|
|
|
+ self.running.remove(session_id)
|
|
|
|
|
|