Skip to content

Commit

Permalink
Sliding Sync: Short-circuit `have_finished_sliding_sync_background_jo…
Browse files Browse the repository at this point in the history
…bs` (#17723)

We only need to check it if returned bump stamp is `None`, which is rare.

Pulling this change out from one of @erikjohnston's branches
(develop...erikj/ss_perf)
  • Loading branch information
MadLittleMods authored Sep 17, 2024
1 parent d40bc27 commit 8881ad6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions changelog.d/17723.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fetch `bump_stamp`'s more efficiently in Sliding Sync.
4 changes: 2 additions & 2 deletions synapse/handlers/sliding_sync/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1171,8 +1171,8 @@ async def _get_bump_stamp(
# `SCHEMA_COMPAT_VERSION` and run the foreground update for
# `sliding_sync_joined_rooms`/`sliding_sync_membership_snapshots`
# (tracked by https://github.com/element-hq/synapse/issues/17623)
await self.store.have_finished_sliding_sync_background_jobs()
and latest_room_bump_stamp is None
latest_room_bump_stamp is None
and await self.store.have_finished_sliding_sync_background_jobs()
):
return None

Expand Down

0 comments on commit 8881ad6

Please sign in to comment.