summary refs log tree commit diff
path: root/synapse/util
diff options
context:
space:
mode:
Diffstat (limited to 'synapse/util')
-rw-r--r--synapse/util/caches/snapshot_cache.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/synapse/util/caches/snapshot_cache.py b/synapse/util/caches/snapshot_cache.py
index b19aca05ab..8a7ca47a86 100644
--- a/synapse/util/caches/snapshot_cache.py
+++ b/synapse/util/caches/snapshot_cache.py
@@ -28,14 +28,14 @@ class SnapshotCache(object):
 
     def rotate(self, time_now_ms):
         # Rotate once if the cache duration has passed since the last rotation.
-        if time_now_ms - self.time_last_rotated_ms > self.DURATION_MS:
+        if time_now_ms - self.time_last_rotated_ms >= self.DURATION_MS:
             self.prev_result_cache = self.next_result_cache
             self.next_result_cache = {}
             self.time_last_rotated_ms += self.DURATION_MS
 
         # Rotate again if the cache duration has passed twice since the last
         # rotation.
-        if time_now_ms - self.time_last_rotated_ms > self.DURATION_MS:
+        if time_now_ms - self.time_last_rotated_ms >= self.DURATION_MS:
             self.prev_result_cache = self.next_result_cache
             self.next_result_cache = {}
             self.time_last_rotated_ms = time_now_ms