diff options
author | Mark Haines <mark.haines@matrix.org> | 2015-12-23 11:48:03 +0000 |
---|---|---|
committer | Mark Haines <mark.haines@matrix.org> | 2015-12-23 11:48:03 +0000 |
commit | 7fa71e32670aa0ed2b49d04fd3c66a72e8fbc1cf (patch) | |
tree | 4dfce06d1cba69874edb0475c9102892e28723fb /synapse/util/caches/snapshot_cache.py | |
parent | Move the doc string to the public facing method (diff) | |
download | synapse-7fa71e32670aa0ed2b49d04fd3c66a72e8fbc1cf.tar.xz |
Add a unit test for the snapshot cache
Diffstat (limited to 'synapse/util/caches/snapshot_cache.py')
-rw-r--r-- | synapse/util/caches/snapshot_cache.py | 4 |
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 |