diff options
author | Erik Johnston <erikj@element.io> | 2024-08-09 11:59:44 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-09 11:59:44 +0100 |
commit | 70b0e386032ed2f3ecf25fcf9a4b6c31335ffdc4 (patch) | |
tree | af2d4124991c6044485d7fdf203a24b8c21c7410 /synapse/storage | |
parent | Start handlers for new media endpoints when media resource configured (#17483) (diff) | |
download | synapse-70b0e386032ed2f3ecf25fcf9a4b6c31335ffdc4.tar.xz |
Fix performance of device lists in `/key/changes` and sliding sync (#17537) HEAD github/develop develop
We do this by reusing the code from sync v2. Reviewable commit-by-commit. The function `get_user_ids_changed` has been rewritten entirely, so I would recommend not looking at the diff.
Diffstat (limited to '')
-rw-r--r-- | synapse/storage/databases/main/state_deltas.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/synapse/storage/databases/main/state_deltas.py b/synapse/storage/databases/main/state_deltas.py index 9ed39e688a..7d491d1728 100644 --- a/synapse/storage/databases/main/state_deltas.py +++ b/synapse/storage/databases/main/state_deltas.py @@ -166,6 +166,11 @@ class StateDeltasStore(SQLBaseStore): ) -> List[StateDelta]: """Get the state deltas between two tokens.""" + if not self._curr_state_delta_stream_cache.has_entity_changed( + room_id, from_token.stream + ): + return [] + def get_current_state_deltas_for_room_txn( txn: LoggingTransaction, ) -> List[StateDelta]: |