summary refs log tree commit diff
path: root/synapse/util/caches
diff options
context:
space:
mode:
authorErik Johnston <erikj@jki.re>2017-06-29 14:20:24 +0100
committerGitHub <noreply@github.com>2017-06-29 14:20:24 +0100
commita1a253ea50db639264596170546976026430f58d (patch)
tree1c7fe67f2f43b2c833f7e8bf46b5b40d120a30bb /synapse/util/caches
parentMerge branch 'release-v0.22.0' of github.com:matrix-org/synapse into develop (diff)
parentUse an ExpiringCache for storing registration sessions (diff)
downloadsynapse-a1a253ea50db639264596170546976026430f58d.tar.xz
Merge pull request #2319 from matrix-org/erikj/prune_sessions
Use an ExpiringCache for storing registration sessions
Diffstat (limited to 'synapse/util/caches')
-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]