1
0
mirror of https://github.com/krateng/maloja.git synced 2023-08-10 21:12:55 +03:00

Clearing entity cache after maintenance

This commit is contained in:
krateng 2022-04-03 16:16:18 +02:00
parent b96f0cfc08
commit 31c6fe6243
2 changed files with 9 additions and 1 deletions

View File

@ -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

View File

@ -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()