Skip to content

Commit

Permalink
Fix bug where StreamChangeCache would not respect cache factors (#1…
Browse files Browse the repository at this point in the history
…7152)

Annoyingly mypy didn't pick up this typo.
  • Loading branch information
erikjohnston authored May 3, 2024
1 parent 3818597 commit 7c9ac01
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog.d/17152.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix bug where `StreamChangeCache` would not respect configured cache factors.
2 changes: 1 addition & 1 deletion synapse/util/caches/stream_change_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def set_cache_factor(self, factor: float) -> bool:
"""
new_size = math.floor(self._original_max_size * factor)
if new_size != self._max_size:
self.max_size = new_size
self._max_size = new_size
self._evict()
return True
return False
Expand Down

0 comments on commit 7c9ac01

Please sign in to comment.