mirror of
https://github.com/element-hq/synapse.git
synced 2025-03-06 16:06:52 +00:00
Comments
This commit is contained in:
parent
6f274f7e13
commit
dcefac3b06
1 changed files with 3 additions and 0 deletions
|
@ -26,6 +26,9 @@ DictionaryEntry = namedtuple("DictionaryEntry", ("full", "value"))
|
||||||
|
|
||||||
|
|
||||||
class DictionaryCache(object):
|
class DictionaryCache(object):
|
||||||
|
"""Caches key -> dictionary lookups, supporting caching partial dicts, i.e.
|
||||||
|
fetching a subset of dictionary keys for a particular key.
|
||||||
|
"""
|
||||||
|
|
||||||
def __init__(self, name, max_entries=1000):
|
def __init__(self, name, max_entries=1000):
|
||||||
self.cache = LruCache(max_size=max_entries)
|
self.cache = LruCache(max_size=max_entries)
|
||||||
|
|
Loading…
Add table
Reference in a new issue