mirror of
https://github.com/zhayujie/chatgpt-on-wechat.git
synced 2026-05-04 01:41:45 +08:00
Update chat_gpt_bot.py retry APIConnectionError
This commit is contained in:
@@ -148,8 +148,9 @@ class ChatGPTBot(Bot, OpenAIImage):
|
|||||||
time.sleep(10)
|
time.sleep(10)
|
||||||
elif isinstance(e, openai.error.APIConnectionError):
|
elif isinstance(e, openai.error.APIConnectionError):
|
||||||
logger.warn("[CHATGPT] APIConnectionError: {}".format(e))
|
logger.warn("[CHATGPT] APIConnectionError: {}".format(e))
|
||||||
need_retry = False
|
|
||||||
result["content"] = "我连接不到你的网络"
|
result["content"] = "我连接不到你的网络"
|
||||||
|
if need_retry:
|
||||||
|
time.sleep(5)
|
||||||
else:
|
else:
|
||||||
logger.exception("[CHATGPT] Exception: {}".format(e))
|
logger.exception("[CHATGPT] Exception: {}".format(e))
|
||||||
need_retry = False
|
need_retry = False
|
||||||
|
|||||||
Reference in New Issue
Block a user