-
-
Notifications
You must be signed in to change notification settings - Fork 199
Open
Description
I'm seeing a really strange behaviour where the CACHE_THRESHOLD value is only honoured exactly at midnight: at this time the cache is cleaned from old copies and only the number specified in CACHE_THRESHOLD survives.
During the rest of the day, instead, the cache grows indefinitely and the number of items surpasses the number set in CACHE_THRESHOLD, as shown by this disk usage graph on my server.
Surely I'm interpreting the documentation wrong or doing something bad in my code, but I'm setting the cache as easily as this
from flask_caching import Cache
cache = Cache(config={"CACHE_TYPE": "filesystem",
"CACHE_DIR": cache_dir,
"CACHE_THRESHOLD": 20})and decorating the functions with
@cache.memoize(240)
def get_radar_data(
data_path=CACHE_DIR,
base_radar_url=RADAR_URL,
):Do you know what could be the issue?
Environment:
- Python version: 3.12.3
- Flask-Caching version: 2.1.0
Metadata
Metadata
Assignees
Labels
No labels
