From 0e86d2aa9ae95beda188fa4a186a9c7dea8c870f Mon Sep 17 00:00:00 2001 From: freeziyou <80776877@qq.com> Date: Sat, 3 Feb 2024 16:40:16 +0800 Subject: [PATCH] add cache expire time --- server/utils/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/utils/utils.py b/server/utils/utils.py index 04ed860c..bc416bd9 100644 --- a/server/utils/utils.py +++ b/server/utils/utils.py @@ -19,7 +19,7 @@ def upload_image(url, bot): return "" -@stalecache(expire=3600, stale=600) +@stalecache(expire=86400, stale=600) def upload_private_image(url, access_token, bot): img_bin = download_image_with_token(access_token, url) if img_bin: @@ -58,6 +58,7 @@ def download_image_with_token(access_token: str, url: str) -> str | None: "Authorization": f"Bearer {access_token}", "X-GitHub-Api-Version": "2022-11-28", }, + follow_redirects=True, ) if response.status_code != 200: