🚸 Add the screenshot_timeout parameter to the template_to_pic method to increase the timeout to avoid loading failure.

This commit is contained in:
BalconyJH 2024-10-31 21:43:54 +08:00
parent 2ab1994e5a
commit 79b26f7188
No known key found for this signature in database
GPG Key ID: FF602923BD2A1FAF
4 changed files with 4 additions and 0 deletions

View File

@ -50,6 +50,7 @@ async def build_html_help():
"base_url": f"file://{TEMPLATE_PATH}", "base_url": f"file://{TEMPLATE_PATH}",
}, },
wait=2, wait=2,
screenshot_timeout=60_000,
) )
result = await BuildImage.open(pic).resize(0.5) result = await BuildImage.open(pic).resize(0.5)
await result.save(ADMIN_HELP_IMAGE) await result.save(ADMIN_HELP_IMAGE)

View File

@ -133,4 +133,5 @@ async def build_html_image(group_id: str | None) -> bytes:
"base_url": f"file://{TEMPLATE_PATH}", "base_url": f"file://{TEMPLATE_PATH}",
}, },
wait=2, wait=2,
screenshot_timeout=60_000,
) )

View File

@ -151,4 +151,5 @@ async def build_zhenxun_image(session: Uninfo, group_id: str | None) -> bytes:
"base_url": f"file://{TEMPLATE_PATH}", "base_url": f"file://{TEMPLATE_PATH}",
}, },
wait=2, wait=2,
screenshot_timeout=60_000,
) )

View File

@ -54,6 +54,7 @@ async def build_html_help():
"base_url": f"file://{TEMPLATE_PATH}", "base_url": f"file://{TEMPLATE_PATH}",
}, },
wait=2, wait=2,
screenshot_timeout=60_000,
) )
result = await BuildImage.open(pic).resize(0.5) result = await BuildImage.open(pic).resize(0.5)
await result.save(SUPERUSER_HELP_IMAGE) await result.save(SUPERUSER_HELP_IMAGE)