##// END OF EJS Templates
logging: added better cached/uncached functions logs
marcink -
r750:cbb81f7e default
parent child Browse files
Show More
@@ -60,15 +60,16 b' class RhodeCodeCacheRegion(CacheRegion):'
60
60
61 @functools.wraps(fn)
61 @functools.wraps(fn)
62 def creator():
62 def creator():
63 log.debug('Calling cached fn:%s', fn)
64 return fn(*arg, **kw)
63 return fn(*arg, **kw)
65
64
66 if not condition:
65 if not condition:
66 log.debug('Calling un-cached func:%s', fn)
67 return creator()
67 return creator()
68
68
69 timeout = expiration_time() if expiration_time_is_callable \
69 timeout = expiration_time() if expiration_time_is_callable \
70 else expiration_time
70 else expiration_time
71
71
72 log.debug('Calling cached fn:%s', fn)
72 return self.get_or_create(key, creator, timeout, should_cache_fn)
73 return self.get_or_create(key, creator, timeout, should_cache_fn)
73
74
74 def invalidate(*arg, **kw):
75 def invalidate(*arg, **kw):
General Comments 0
You need to be logged in to leave comments. Login now