summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2017-02-02 14:47:15 +0000
committerErik Johnston <erik@matrix.org>2017-02-02 14:47:15 +0000
commit6b61060b51970bd170fffd442df0e9f02ddcf678 (patch)
tree58fbfa94275cb226ffb85f01b306d8925edcec17
parentComment (diff)
downloadsynapse-6b61060b51970bd170fffd442df0e9f02ddcf678.tar.xz
Comment
-rw-r--r--synapse/util/caches/descriptors.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/synapse/util/caches/descriptors.py b/synapse/util/caches/descriptors.py
index 3c6838df16..998de70d29 100644
--- a/synapse/util/caches/descriptors.py
+++ b/synapse/util/caches/descriptors.py
@@ -479,7 +479,10 @@ class CacheListDescriptor(object):
 
 class _CacheContext(namedtuple("_CacheContext", ("cache", "key"))):
     # We rely on _CacheContext implementing __eq__ and __hash__ sensibly,
-    # which namedtuple does for us.
+    # 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)