diff options
author | Amber Brown <hawkowl@atleastfornow.net> | 2018-07-17 13:44:46 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-17 13:44:46 +1000 |
commit | 3fe0938b76e0888a5147bbade99e120ea0505605 (patch) | |
tree | 3e61a930caf3ebd70f2741c28dba963c15e40cc7 /synapse/util/caches/stream_change_cache.py | |
parent | Merge pull request #3540 from krombel/enforce_isort (diff) | |
parent | Fixup unit test (diff) | |
download | synapse-3fe0938b76e0888a5147bbade99e120ea0505605.tar.xz |
Merge pull request #3530 from matrix-org/erikj/stream_cache
Don't return unknown entities in get_entities_changed
Diffstat (limited to 'synapse/util/caches/stream_change_cache.py')
-rw-r--r-- | synapse/util/caches/stream_change_cache.py | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/synapse/util/caches/stream_change_cache.py b/synapse/util/caches/stream_change_cache.py index a1f8ff8f10..258655349b 100644 --- a/synapse/util/caches/stream_change_cache.py +++ b/synapse/util/caches/stream_change_cache.py @@ -74,19 +74,12 @@ class StreamChangeCache(object): assert type(stream_pos) is int if stream_pos >= self._earliest_known_stream_pos: - changed_entities = { + result = { self._cache[k] for k in self._cache.islice( start=self._cache.bisect_right(stream_pos), ) } - # we need to include entities which we don't know about, as well as - # those which are known to have changed since the stream pos. - result = { - e for e in entities - if e in changed_entities or e not in self._entity_to_key - } - self.metrics.inc_hits() else: result = set(entities) |