summary refs log tree commit diff
path: root/synapse/util/caches/lrucache.py
diff options
context:
space:
mode:
Diffstat (limited to 'synapse/util/caches/lrucache.py')
-rw-r--r--synapse/util/caches/lrucache.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/synapse/util/caches/lrucache.py b/synapse/util/caches/lrucache.py
index 5a0f9992c5..47998d6f07 100644
--- a/synapse/util/caches/lrucache.py
+++ b/synapse/util/caches/lrucache.py
@@ -292,9 +292,10 @@ class LruCache(Generic[KT, VT]):
                 ten_minutes_ago = int(reactor.seconds()) - 10 * 60
                 if 0 < node.allocated_ts < ten_minutes_ago:
                     delete_node(node)
+                    cache.pop(node.key, None)
                 else:
                     move_node_to_front(node)
-                node.callbacks.update(callbacks)
+                    node.callbacks.update(callbacks)
                 if update_metrics and metrics:
                     metrics.inc_hits()
                 return node.value