From 79b26f71883efde40cac1626379ef184415789b4 Mon Sep 17 00:00:00 2001 From: BalconyJH Date: Thu, 31 Oct 2024 21:43:54 +0800 Subject: [PATCH] :children_crossing: Add the screenshot_timeout parameter to the template_to_pic method to increase the timeout to avoid loading failure. --- zhenxun/builtin_plugins/admin/admin_help/html_help.py | 1 + zhenxun/builtin_plugins/help/html_help.py | 1 + zhenxun/builtin_plugins/help/zhenxun_help.py | 1 + zhenxun/builtin_plugins/superuser/super_help/zhenxun_help.py | 1 + 4 files changed, 4 insertions(+) diff --git a/zhenxun/builtin_plugins/admin/admin_help/html_help.py b/zhenxun/builtin_plugins/admin/admin_help/html_help.py index 653dcff6..f432124a 100644 --- a/zhenxun/builtin_plugins/admin/admin_help/html_help.py +++ b/zhenxun/builtin_plugins/admin/admin_help/html_help.py @@ -50,6 +50,7 @@ async def build_html_help(): "base_url": f"file://{TEMPLATE_PATH}", }, wait=2, + screenshot_timeout=60_000, ) result = await BuildImage.open(pic).resize(0.5) await result.save(ADMIN_HELP_IMAGE) diff --git a/zhenxun/builtin_plugins/help/html_help.py b/zhenxun/builtin_plugins/help/html_help.py index 5e88fc28..1dc921d8 100644 --- a/zhenxun/builtin_plugins/help/html_help.py +++ b/zhenxun/builtin_plugins/help/html_help.py @@ -133,4 +133,5 @@ async def build_html_image(group_id: str | None) -> bytes: "base_url": f"file://{TEMPLATE_PATH}", }, wait=2, + screenshot_timeout=60_000, ) diff --git a/zhenxun/builtin_plugins/help/zhenxun_help.py b/zhenxun/builtin_plugins/help/zhenxun_help.py index 427e39ec..344e2a1c 100644 --- a/zhenxun/builtin_plugins/help/zhenxun_help.py +++ b/zhenxun/builtin_plugins/help/zhenxun_help.py @@ -151,4 +151,5 @@ async def build_zhenxun_image(session: Uninfo, group_id: str | None) -> bytes: "base_url": f"file://{TEMPLATE_PATH}", }, wait=2, + screenshot_timeout=60_000, ) diff --git a/zhenxun/builtin_plugins/superuser/super_help/zhenxun_help.py b/zhenxun/builtin_plugins/superuser/super_help/zhenxun_help.py index cf389e87..e86ebf0f 100644 --- a/zhenxun/builtin_plugins/superuser/super_help/zhenxun_help.py +++ b/zhenxun/builtin_plugins/superuser/super_help/zhenxun_help.py @@ -54,6 +54,7 @@ async def build_html_help(): "base_url": f"file://{TEMPLATE_PATH}", }, wait=2, + screenshot_timeout=60_000, ) result = await BuildImage.open(pic).resize(0.5) await result.save(SUPERUSER_HELP_IMAGE)