diff --git a/maloja/database/dbcache.py b/maloja/database/dbcache.py index caacfe1..89baea0 100644 --- a/maloja/database/dbcache.py +++ b/maloja/database/dbcache.py @@ -110,6 +110,9 @@ def invalidate_caches(scrobbletime): log(f"Invalidated {cleared} of {cleared+kept} DB cache entries") +def invalidate_entity_cache(): + entitycache.clear() + def trim_cache(): ramprct = psutil.virtual_memory().percent diff --git a/maloja/database/sqldb.py b/maloja/database/sqldb.py index de79c8c..42cc50a 100644 --- a/maloja/database/sqldb.py +++ b/maloja/database/sqldb.py @@ -6,7 +6,7 @@ from datetime import datetime from ..globalconf import data_dir -from .dbcache import cached_wrapper, cached_wrapper_individual +from .dbcache import cached_wrapper, cached_wrapper_individual, invalidate_entity_cache from doreah.logging import log from doreah.regular import runhourly @@ -652,6 +652,11 @@ def clean_db(): + # Clear caches + invalidate_entity_cache() + + +