summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2021-04-01 16:50:08 +0100
committerErik Johnston <erik@matrix.org>2021-04-01 16:50:08 +0100
commit3d6c982c4111376b5295a101d22979e753dcb5b9 (patch)
tree72e96f10d8b0256ce8f09618f8d5448b54e5df70
parentMerge remote-tracking branch 'origin/develop' into erikj/cache_memory_usage (diff)
downloadsynapse-3d6c982c4111376b5295a101d22979e753dcb5b9.tar.xz
Randomise
-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 e0c0e41a55..be9cb92735 100644
--- a/synapse/util/caches/lrucache.py
+++ b/synapse/util/caches/lrucache.py
@@ -27,6 +27,7 @@ from typing import (
     cast,
     overload,
 )
+import random
 
 from typing_extensions import Literal
 
@@ -87,7 +88,7 @@ class _Node:
 
         self.prev_node = prev_node
         self.next_node = next_node
-        self.allocated_ts = int(reactor.seconds())
+        self.allocated_ts = int(reactor.seconds()) + random.randint(-30, 30)
 
 
 class LruCache(Generic[KT, VT]):