Skip to content

Commit

Permalink
add cache expire time
Browse files Browse the repository at this point in the history
  • Loading branch information
freeziyou committed Feb 3, 2024
1 parent dcc931e commit 0e86d2a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion server/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 0e86d2a

Please sign in to comment.