mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 11:06:07 -04:00
During room intial sync, only calculate current state once.
This commit is contained in:
parent
76c5a5c2f6
commit
d94f682a4c
4 changed files with 43 additions and 21 deletions
|
@ -175,9 +175,10 @@ class SyncHandler(BaseHandler):
|
|||
room_id, sync_config, now_token,
|
||||
)
|
||||
|
||||
current_state_events = yield self.state_handler.get_current_state(
|
||||
current_state = yield self.state_handler.get_current_state(
|
||||
room_id
|
||||
)
|
||||
current_state_events = current_state.values()
|
||||
|
||||
defer.returnValue(RoomSyncResult(
|
||||
room_id=room_id,
|
||||
|
@ -347,9 +348,10 @@ class SyncHandler(BaseHandler):
|
|||
|
||||
# TODO(mjark): This seems racy since this isn't being passed a
|
||||
# token to indicate what point in the stream this is
|
||||
current_state_events = yield self.state_handler.get_current_state(
|
||||
current_state = yield self.state_handler.get_current_state(
|
||||
room_id
|
||||
)
|
||||
current_state_events = current_state.values()
|
||||
|
||||
state_at_previous_sync = yield self.get_state_at_previous_sync(
|
||||
room_id, since_token=since_token
|
||||
|
@ -431,6 +433,7 @@ class SyncHandler(BaseHandler):
|
|||
joined = True
|
||||
|
||||
if joined:
|
||||
state_delta = yield self.state_handler.get_current_state(room_id)
|
||||
res = yield self.state_handler.get_current_state(room_id)
|
||||
state_delta = res.values()
|
||||
|
||||
defer.returnValue(state_delta)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue