diff options
author | Erik Johnston <erik@matrix.org> | 2021-04-02 09:55:47 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2021-04-02 09:55:47 +0100 |
commit | b05667b61072fa6d537321f19338f271327e52d7 (patch) | |
tree | 2f37e579a35ffd1764fe1c6412714bb0854a0c5e | |
parent | fixup (diff) | |
download | synapse-b05667b61072fa6d537321f19338f271327e52d7.tar.xz |
Don't limit
-rw-r--r-- | synapse/util/caches/lrucache.py | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/synapse/util/caches/lrucache.py b/synapse/util/caches/lrucache.py index 47998d6f07..2ea4a63e5a 100644 --- a/synapse/util/caches/lrucache.py +++ b/synapse/util/caches/lrucache.py @@ -175,13 +175,11 @@ class LruCache(Generic[KT, VT]): lock = threading.Lock() def evict(): - i = 0 ten_minutes_ago = int(reactor.seconds()) - 10 * 60 - while i < 100 and ( + while ( cache_len() > self.max_size or 0 < list_root.prev_node.allocated_ts < ten_minutes_ago + 60 ): - i += 1 todelete = list_root.prev_node if 0 < todelete.allocated_ts < ten_minutes_ago: |