From 26169abc2fdca1dca0b9d3933679c9484eb9e40e Mon Sep 17 00:00:00 2001 From: Colin Maudry Date: Sun, 19 Apr 2026 15:29:34 +0200 Subject: [PATCH] =?UTF-8?q?Suppression=20du=20cache=20=C3=A0=20chaque=20re?= =?UTF-8?q?d=C3=A9marrage?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/app.py b/src/app.py index d3a2777..eb3b332 100644 --- a/src/app.py +++ b/src/app.py @@ -1,4 +1,5 @@ import os +from shutil import rmtree import dash_bootstrap_components as dbc import tomllib @@ -32,15 +33,17 @@ app: Dash = Dash( meta_tags=META_TAGS, ) +rmtree(os.getenv("CACHE_DIR", "/tmp/decp-cache")) + cache.init_app( app.server, config={ "CACHE_TYPE": "FileSystemCache", "CACHE_DIR": os.getenv("CACHE_DIR", "/tmp/decp-cache"), "CACHE_DEFAULT_TIMEOUT": int( - os.getenv("CACHE_DEFAULT_TIMEOUT", 3600 * 20) - ), # 20h par défaut - "CACHE_THRESHOLD": 500, + os.getenv("CACHE_DEFAULT_TIMEOUT", 3600 * 24) + ), # 24h par défaut + "CACHE_THRESHOLD": 300, }, )