mirror of
https://github.com/krateng/maloja.git
synced 2023-08-10 21:12:55 +03:00
Removed previous ability, but this time clean and consistent
This commit is contained in:
parent
7c77474feb
commit
d5f5b48d85
@ -10,6 +10,11 @@ from doreah.logging import log
|
||||
|
||||
from ..pkg_global.conf import malojaconfig
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if malojaconfig['USE_GLOBAL_CACHE']:
|
||||
CACHE_SIZE = 1000
|
||||
ENTITY_CACHE_SIZE = 100000
|
||||
|
||||
@ -22,7 +27,6 @@ hits, misses = 0, 0
|
||||
|
||||
@runhourly
|
||||
def maintenance():
|
||||
if malojaconfig['USE_GLOBAL_CACHE']:
|
||||
print_stats()
|
||||
trim_cache()
|
||||
|
||||
@ -36,9 +40,7 @@ def print_stats():
|
||||
|
||||
def cached_wrapper(inner_func):
|
||||
|
||||
|
||||
def outer_func(*args,**kwargs):
|
||||
if not malojaconfig['USE_GLOBAL_CACHE']: inner_func(*args,**kwargs)
|
||||
|
||||
if 'dbconn' in kwargs:
|
||||
conn = kwargs.pop('dbconn')
|
||||
@ -67,7 +69,6 @@ def cached_wrapper_individual(inner_func):
|
||||
|
||||
|
||||
def outer_func(set_arg,**kwargs):
|
||||
if not malojaconfig['USE_GLOBAL_CACHE']: return inner_func(set_arg,**kwargs)
|
||||
|
||||
|
||||
if 'dbconn' in kwargs:
|
||||
@ -129,6 +130,20 @@ def trim_cache():
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
else:
|
||||
def cached_wrapper(func):
|
||||
return func
|
||||
def cached_wrapper_individual(func):
|
||||
return func
|
||||
def invalidate_caches(scrobbletime=None):
|
||||
return None
|
||||
def invalidate_entity_cache():
|
||||
return None
|
||||
|
||||
|
||||
def serialize(obj):
|
||||
try:
|
||||
return serialize(obj.hashable())
|
||||
|
Loading…
Reference in New Issue
Block a user