From b3828baa5dfb5997d910772428a242982dcb3e5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Ke=C3=9Fler?= Date: Wed, 5 Jul 2023 18:48:19 +0200 Subject: [PATCH] configure cache to store exported games forever --- hanabi/live/site_api.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hanabi/live/site_api.py b/hanabi/live/site_api.py index 41fbfc5..9cb9f27 100644 --- a/hanabi/live/site_api.py +++ b/hanabi/live/site_api.py @@ -8,7 +8,12 @@ from hanabi import logger from hanabi import constants # Cache all requests to site to reduce traffic and latency -session = requests_cache.CachedSession(platformdirs.user_cache_dir(constants.APP_NAME) + '/hanab.live') +session = requests_cache.CachedSession( + platformdirs.user_cache_dir(constants.APP_NAME) + '/hanab.live', + urls_expire_after={ + 'hanab.live/export/*': requests_cache.NEVER_EXPIRE + } +) def get(url, refresh=False) -> Optional[Dict | str]: