diff options
author | Erik Johnston <erik@matrix.org> | 2015-05-21 17:16:10 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2015-05-21 17:16:10 +0100 |
commit | 51f5d36f4fcb9b5bd3b1afbf2dcb9d823f2cf84a (patch) | |
tree | a44a6260e7b7f5622785d615a46184e19d21d2ca /synapse/storage/_base.py | |
parent | Merge branch 'hotfixes-v0.9.0-r4' of github.com:matrix-org/synapse (diff) | |
parent | Bump version (diff) | |
download | synapse-51f5d36f4fcb9b5bd3b1afbf2dcb9d823f2cf84a.tar.xz |
Merge branch 'hotfixes-v0.9.0-r5' of github.com:matrix-org/synapse
Diffstat (limited to 'synapse/storage/_base.py')
-rw-r--r-- | synapse/storage/_base.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/synapse/storage/_base.py b/synapse/storage/_base.py index 9e348590ba..c8c76e58fe 100644 --- a/synapse/storage/_base.py +++ b/synapse/storage/_base.py @@ -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. @@ -175,6 +180,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 |