@@ -94,14 +94,11 @@ class RobotMenuPlugin(MessagePluginInterface):
|
||||
self.sync_send_timeout_seconds = int(
|
||||
self._config.get("RobotMenu", {}).get("sync_send_timeout_seconds", 18)
|
||||
)
|
||||
# 只有在图片模式下,菜单插件才需要声明更紧的外层超时预算:
|
||||
# 1. 文本模式本身非常快,没有必要覆盖全局默认超时;
|
||||
# 2. 图片模式下才需要给“渲染 + 文本回退”预留一个略大于内层预算的缓冲区;
|
||||
# 3. 这样默认文本模式下不会额外引入无意义的超时特化逻辑。
|
||||
if RobotMenuRenderTool.normalize_output_mode(output_mode) == "image":
|
||||
self.plugin_process_timeout_seconds = max(12, self.sync_send_timeout_seconds + 8)
|
||||
elif hasattr(self, "plugin_process_timeout_seconds"):
|
||||
delattr(self, "plugin_process_timeout_seconds")
|
||||
# 对外层插件保护显式声明一个更合适的总超时:
|
||||
# 1. 内层菜单发送会在 sync_send_timeout_seconds 内决定“成功发图 / 回退文本 / 返回失败提示”;
|
||||
# 2. 外层 wait_for 必须比内层稍长,给降级发送文本留出缓冲;
|
||||
# 3. 这样可以避免过去“内外层都卡在 55 秒”时,外层先打断,导致降级逻辑来不及执行。
|
||||
self.plugin_process_timeout_seconds = max(12, self.sync_send_timeout_seconds + 8)
|
||||
# 菜单图片模板文件路径(相对仓库根目录):
|
||||
# 调整样式和布局时只改模板,不改 Python 逻辑。
|
||||
self.image_template_path = str(
|
||||
|
||||
Reference in New Issue
Block a user