summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2021-04-01 17:46:14 +0100
committerErik Johnston <erik@matrix.org>2021-04-01 17:46:14 +0100
commit2bb036eda7d8f66f71dbde95f6aca53b7a7b32cd (patch)
tree90dd79347ac28ad7b3dfb54ba1a6b2da75770e97
parentFixup (diff)
downloadsynapse-2bb036eda7d8f66f71dbde95f6aca53b7a7b32cd.tar.xz
fixup
-rw-r--r--synapse/util/caches/lrucache.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/synapse/util/caches/lrucache.py b/synapse/util/caches/lrucache.py
index 9f5928b2f1..5a0f9992c5 100644
--- a/synapse/util/caches/lrucache.py
+++ b/synapse/util/caches/lrucache.py
@@ -182,7 +182,9 @@ class LruCache(Generic[KT, VT]):
                 or 0 < list_root.prev_node.allocated_ts < ten_minutes_ago + 60
             ):
                 i += 1
-                if list_root.prev_node.allocated_ts > ten_minutes_ago:
+                todelete = list_root.prev_node
+
+                if 0 < todelete.allocated_ts < ten_minutes_ago:
                     continue
 
                 todelete = list_root.prev_node