mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 12:16:09 -04:00
Merge branch 'master' of github.com:matrix-org/synapse into develop
This commit is contained in:
commit
4429e720ae
11 changed files with 94 additions and 37 deletions
|
@ -121,6 +121,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.
|
||||
|
@ -172,6 +177,7 @@ def cached(max_entries=1000, num_args=1, lru=False):
|
|||
defer.returnValue(ret)
|
||||
|
||||
wrapped.invalidate = cache.invalidate
|
||||
wrapped.invalidate_all = cache.invalidate_all
|
||||
wrapped.prefill = cache.prefill
|
||||
return wrapped
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue