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

Re-enabled cache per default

This commit is contained in:
krateng 2022-04-25 03:24:16 +02:00
parent 95f98370cf
commit c55e12dd43
3 changed files with 5 additions and 4 deletions

View File

@ -1,3 +1,3 @@
- "[Bugix] Improved signal handling" - "[Bugix] Improved signal handling"
- "[Bugix] Fixed constant re-caching of all-time stats" - "[Bugix] Fixed constant re-caching of all-time stats. significantly increasing page load speed"
- "[Performance] Disabled caches per default" - "[Logging] Disabled cache information when cache is not used"

View File

@ -23,6 +23,7 @@ class JinjaDBConnection:
return self return self
def __exit__(self, exc_type, exc_value, exc_traceback): def __exit__(self, exc_type, exc_value, exc_traceback):
self.conn.close() self.conn.close()
if malojaconfig['USE_REQUEST_CACHE']:
log(f"Generated page with {self.hits}/{self.hits+self.misses} local Cache hits",module="debug_performance") log(f"Generated page with {self.hits}/{self.hits+self.misses} local Cache hits",module="debug_performance")
del self.cache del self.cache
def __getattr__(self,name): def __getattr__(self,name):

View File

@ -150,7 +150,7 @@ malojaconfig = Configuration(
"cache_expire_negative":(tp.Integer(), "Image Cache Negative Expiration", 5, "Days until failed image fetches are reattempted"), "cache_expire_negative":(tp.Integer(), "Image Cache Negative Expiration", 5, "Days until failed image fetches are reattempted"),
"db_max_memory":(tp.Integer(min=0,max=100), "RAM Percentage soft limit", 80, "RAM Usage in percent at which Maloja should no longer increase its database cache."), "db_max_memory":(tp.Integer(min=0,max=100), "RAM Percentage soft limit", 80, "RAM Usage in percent at which Maloja should no longer increase its database cache."),
"use_request_cache":(tp.Boolean(), "Use request-local DB Cache", False), "use_request_cache":(tp.Boolean(), "Use request-local DB Cache", False),
"use_global_cache":(tp.Boolean(), "Use global DB Cache", False) "use_global_cache":(tp.Boolean(), "Use global DB Cache", True)
}, },
"Fluff":{ "Fluff":{
"scrobbles_gold":(tp.Integer(), "Scrobbles for Gold", 250, "How many scrobbles a track needs to be considered 'Gold' status"), "scrobbles_gold":(tp.Integer(), "Scrobbles for Gold", 250, "How many scrobbles a track needs to be considered 'Gold' status"),