##// END OF EJS Templates
caches: added reprs
marcink -
r3933:37529f8b default
parent child Browse files
Show More
@@ -161,6 +161,9 b' class FileNamespaceBackend(PickleSeriali'
161 arguments['lock_factory'] = CustomLockFactory
161 arguments['lock_factory'] = CustomLockFactory
162 super(FileNamespaceBackend, self).__init__(arguments)
162 super(FileNamespaceBackend, self).__init__(arguments)
163
163
164 def __repr__(self):
165 return '{} `{}`'.format(self.__class__, self.filename)
166
164 def list_keys(self, prefix=''):
167 def list_keys(self, prefix=''):
165 prefix = '{}:{}'.format(self.key_prefix, prefix)
168 prefix = '{}:{}'.format(self.key_prefix, prefix)
166
169
@@ -60,7 +60,7 b' class RhodeCodeCacheRegion(CacheRegion):'
60 def get_or_create_for_user_func(key_generator, user_func, *arg, **kw):
60 def get_or_create_for_user_func(key_generator, user_func, *arg, **kw):
61
61
62 if not condition:
62 if not condition:
63 log.debug('Calling un-cached func:%s', user_func)
63 log.debug('Calling un-cached func:%s', user_func.func_name)
64 return user_func(*arg, **kw)
64 return user_func(*arg, **kw)
65
65
66 key = key_generator(*arg, **kw)
66 key = key_generator(*arg, **kw)
@@ -68,7 +68,7 b' class RhodeCodeCacheRegion(CacheRegion):'
68 timeout = expiration_time() if expiration_time_is_callable \
68 timeout = expiration_time() if expiration_time_is_callable \
69 else expiration_time
69 else expiration_time
70
70
71 log.debug('Calling cached fn:%s', user_func)
71 log.debug('Calling cached fn:%s', user_func.func_name)
72 return self.get_or_create(key, user_func, timeout, should_cache_fn, (arg, kw))
72 return self.get_or_create(key, user_func, timeout, should_cache_fn, (arg, kw))
73
73
74 def cache_decorator(user_func):
74 def cache_decorator(user_func):
General Comments 0
You need to be logged in to leave comments. Login now