mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 12:06:08 -04:00
Add a cache for get_current_state with state_key
This commit is contained in:
parent
e89ca34e0e
commit
d61ce3f670
5 changed files with 46 additions and 2 deletions
|
@ -124,6 +124,11 @@ class Cache(object):
|
|||
self.sequence += 1
|
||||
self.cache.pop(keyargs, None)
|
||||
|
||||
def invalidate_all(self):
|
||||
self.check_thread()
|
||||
self.sequence += 1
|
||||
self.cache.clear()
|
||||
|
||||
|
||||
def cached(max_entries=1000, num_args=1, lru=False):
|
||||
""" A method decorator that applies a memoizing cache around the function.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue