diff options
author | Mark Haines <mark.haines@matrix.org> | 2015-05-21 11:13:19 +0100 |
---|---|---|
committer | Mark Haines <mark.haines@matrix.org> | 2015-05-21 16:41:39 +0100 |
commit | d61ce3f6707c3f13a21733e356766d0292815ebc (patch) | |
tree | f279764864a6898f160b3e7254b9534f7d4dcaeb /synapse/storage/_base.py | |
parent | Merge branch 'hotfixes-v0.9.0-r4' of github.com:matrix-org/synapse (diff) | |
download | synapse-d61ce3f6707c3f13a21733e356766d0292815ebc.tar.xz |
Add a cache for get_current_state with state_key
Diffstat (limited to 'synapse/storage/_base.py')
-rw-r--r-- | synapse/storage/_base.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/synapse/storage/_base.py b/synapse/storage/_base.py index 9e348590ba..2210b3ddfb 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. |