fix(qqbot): 群消息超时不重试的问题

This commit is contained in:
Rock Chin 2023-01-25 22:43:49 +08:00
parent 71b69a3226
commit 057d8a05d7

View File

@ -225,7 +225,7 @@ class QQBotManager:
event.sender.id)
break
except FunctionTimedOut:
logging.warning("person_{}: 超时".format(event.sender.id))
logging.warning("person_{}: 超时,重试中({})".format(event.sender.id, i))
pkg.openai.session.get_session('person_{}'.format(event.sender.id)).release_response_lock()
if "person_{}".format(event.sender.id) in pkg.qqbot.process.processing:
pkg.qqbot.process.processing.remove('person_{}'.format(event.sender.id))
@ -260,8 +260,10 @@ class QQBotManager:
event.sender.id)
break
except FunctionTimedOut:
logging.warning("group_{}: 超时,重试中".format(event.group.id))
logging.warning("group_{}: 超时,重试中({})".format(event.group.id, i))
pkg.openai.session.get_session('group_{}'.format(event.group.id)).release_response_lock()
if "group_{}".format(event.sender.id) in pkg.qqbot.process.processing:
pkg.qqbot.process.processing.remove('group_{}'.format(event.sender.id))
failed += 1
continue