diff options
author | Erik Johnston <erik@matrix.org> | 2017-06-29 14:08:33 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2017-06-29 14:08:37 +0100 |
commit | c72058bcc6688e3ed9fa600f77f5190441107318 (patch) | |
tree | 1c7fe67f2f43b2c833f7e8bf46b5b40d120a30bb /synapse/util | |
parent | Merge branch 'release-v0.22.0' of github.com:matrix-org/synapse into develop (diff) | |
download | synapse-c72058bcc6688e3ed9fa600f77f5190441107318.tar.xz |
Use an ExpiringCache for storing registration sessions
This is because pruning them was a significant performance drain on matrix.org
Diffstat (limited to 'synapse/util')
-rw-r--r-- | synapse/util/caches/expiringcache.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/synapse/util/caches/expiringcache.py b/synapse/util/caches/expiringcache.py index cbdde34a57..6ad53a6390 100644 --- a/synapse/util/caches/expiringcache.py +++ b/synapse/util/caches/expiringcache.py @@ -94,6 +94,9 @@ class ExpiringCache(object): return entry.value + def __contains__(self, key): + return key in self._cache + def get(self, key, default=None): try: return self[key] |