summary refs log tree commit diff
path: root/synapse/util/caches/stream_change_cache.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2018-07-17 11:18:39 +0100
committerErik Johnston <erik@matrix.org>2018-07-17 11:18:39 +0100
commite4eec87c6a020ef43246b7df9adca5ecbcee1383 (patch)
tree35790106fdff37e7cc1a0ca9dd3fa17aff1ef2eb /synapse/util/caches/stream_change_cache.py
parentMerge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes (diff)
parentMerge pull request #3544 from matrix-org/erikj/fixup_stream_cache (diff)
downloadsynapse-e4eec87c6a020ef43246b7df9adca5ecbcee1383.tar.xz
Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes
Diffstat (limited to 'synapse/util/caches/stream_change_cache.py')
-rw-r--r--synapse/util/caches/stream_change_cache.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/synapse/util/caches/stream_change_cache.py b/synapse/util/caches/stream_change_cache.py

index 258655349b..f2bde74dc5 100644 --- a/synapse/util/caches/stream_change_cache.py +++ b/synapse/util/caches/stream_change_cache.py
@@ -74,12 +74,14 @@ class StreamChangeCache(object): assert type(stream_pos) is int if stream_pos >= self._earliest_known_stream_pos: - result = { + changed_entities = { self._cache[k] for k in self._cache.islice( start=self._cache.bisect_right(stream_pos), ) } + result = changed_entities.intersection(entities) + self.metrics.inc_hits() else: result = set(entities)