增加翻译接口的重试次数,防止读取信息失败
This commit is contained in:
@@ -1740,8 +1740,12 @@ class ScriptManager():
|
||||
LogManager.method_info(f"获取主播的名称:{anchor_name}", "检测消息", udid)
|
||||
LogManager.method_info(f"获取主播最后发送的消息 即将翻译:{last_in}", "检测消息", udid)
|
||||
|
||||
chinese_last_msg_text = ""
|
||||
if last_in is not None:
|
||||
chinese_last_msg_text = Requester.translationToChinese(last_in)
|
||||
for attempt in range(3):
|
||||
chinese_last_msg_text = Requester.translationToChinese(last_in)
|
||||
if chinese_last_msg_text: # 非空则跳出循环
|
||||
break
|
||||
else:
|
||||
chinese_last_msg_text = ""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user