summary refs log tree commit diff
path: root/synapse/util
diff options
context:
space:
mode:
authorErik Johnston <erikj@jki.re>2017-02-02 15:20:14 +0000
committerGitHub <noreply@github.com>2017-02-02 15:20:14 +0000
commita8331897aab4d223460f634fcb7ba4b091e183f1 (patch)
treed330b3a8265a481db2d0e55352c8ec1f0f32359d /synapse/util
parentMerge pull request #1875 from matrix-org/erikj/fix_email_push (diff)
parentFix replication (diff)
downloadsynapse-a8331897aab4d223460f634fcb7ba4b091e183f1.tar.xz
Merge pull request #1876 from matrix-org/erikj/shared_member_store
Make presence.get_new_events a bit faster
Diffstat (limited to 'synapse/util')
-rw-r--r--synapse/util/caches/descriptors.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/synapse/util/caches/descriptors.py b/synapse/util/caches/descriptors.py
index 675bfd5feb..998de70d29 100644
--- a/synapse/util/caches/descriptors.py
+++ b/synapse/util/caches/descriptors.py
@@ -478,6 +478,11 @@ class CacheListDescriptor(object):
 
 
 class _CacheContext(namedtuple("_CacheContext", ("cache", "key"))):
+    # We rely on _CacheContext implementing __eq__ and __hash__ sensibly,
+    # which namedtuple does for us (i.e. two _CacheContext are the same if
+    # their caches and keys match). This is important in particular to
+    # dedupe when we add callbacks to lru cache nodes, otherwise the number
+    # of callbacks would grow.
     def invalidate(self):
         self.cache.invalidate(self.key)