summary refs log tree commit diff
path: root/synapse/util
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2017-06-29 14:08:33 +0100
committerErik Johnston <erik@matrix.org>2017-06-29 14:08:37 +0100
commitc72058bcc6688e3ed9fa600f77f5190441107318 (patch)
tree1c7fe67f2f43b2c833f7e8bf46b5b40d120a30bb /synapse/util
parentMerge branch 'release-v0.22.0' of github.com:matrix-org/synapse into develop (diff)
downloadsynapse-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.py3
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]