From 7c9ac01eb5fd18e564d6650c2c0f853822aec212 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Fri, 3 May 2024 18:00:08 +0100 Subject: [PATCH] Fix bug where `StreamChangeCache` would not respect cache factors (#17152) Annoyingly mypy didn't pick up this typo. --- changelog.d/17152.bugfix | 1 + synapse/util/caches/stream_change_cache.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 changelog.d/17152.bugfix diff --git a/changelog.d/17152.bugfix b/changelog.d/17152.bugfix new file mode 100644 index 0000000000..67aee91672 --- /dev/null +++ b/changelog.d/17152.bugfix @@ -0,0 +1 @@ +Fix bug where `StreamChangeCache` would not respect configured cache factors. diff --git a/synapse/util/caches/stream_change_cache.py b/synapse/util/caches/stream_change_cache.py index d8253bd942..2079ca789c 100644 --- a/synapse/util/caches/stream_change_cache.py +++ b/synapse/util/caches/stream_change_cache.py @@ -115,7 +115,7 @@ class StreamChangeCache: """ 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