##// END OF EJS Templates
caches: allow debug of max_size reached by the MemoryLRU cache.
marcink -
r2887:2a9499df default
parent child Browse files
Show More
@@ -41,7 +41,14 b' class LRUMemoryBackend(memory_backend.Me'
41 41
42 42 def __init__(self, arguments):
43 43 max_size = arguments.pop('max_size', _default_max_size)
44 arguments['cache_dict'] = LRUDict(max_size)
44 callback = None
45 if arguments.pop('log_max_size_reached', None):
46 def evicted(key, value):
47 log.debug(
48 'LRU: evicting key `%s` due to max size %s reach', key, max_size)
49 callback = evicted
50
51 arguments['cache_dict'] = LRUDict(max_size, callback=callback)
45 52 super(LRUMemoryBackend, self).__init__(arguments)
46 53
47 54 def delete(self, key):
General Comments 0
You need to be logged in to leave comments. Login now