mirror of
https://github.com/element-hq/synapse.git
synced 2024-11-24 10:35:46 +03:00
Remove superfluous call to get_state_at when we already have an event for that stream position
This commit is contained in:
parent
60bec24083
commit
9e696bd6a3
1 changed files with 12 additions and 4 deletions
|
@ -845,16 +845,20 @@ class SyncHandler(BaseHandler):
|
||||||
# TODO(mjark) Check for new redactions in the state events.
|
# TODO(mjark) Check for new redactions in the state events.
|
||||||
|
|
||||||
with Measure(self.clock, "compute_state_delta"):
|
with Measure(self.clock, "compute_state_delta"):
|
||||||
current_state = yield self.get_state_at(
|
|
||||||
room_id, stream_position=now_token
|
|
||||||
)
|
|
||||||
|
|
||||||
if full_state:
|
if full_state:
|
||||||
if batch:
|
if batch:
|
||||||
|
current_state = yield self.store.get_state_for_event(
|
||||||
|
batch.events[-1].event_id
|
||||||
|
)
|
||||||
|
|
||||||
state = yield self.store.get_state_for_event(
|
state = yield self.store.get_state_for_event(
|
||||||
batch.events[0].event_id
|
batch.events[0].event_id
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
|
current_state = yield self.get_state_at(
|
||||||
|
room_id, stream_position=now_token
|
||||||
|
)
|
||||||
|
|
||||||
state = current_state
|
state = current_state
|
||||||
|
|
||||||
timeline_state = {
|
timeline_state = {
|
||||||
|
@ -873,6 +877,10 @@ class SyncHandler(BaseHandler):
|
||||||
room_id, stream_position=since_token
|
room_id, stream_position=since_token
|
||||||
)
|
)
|
||||||
|
|
||||||
|
current_state = yield self.store.get_state_for_event(
|
||||||
|
batch.events[-1].event_id
|
||||||
|
)
|
||||||
|
|
||||||
state_at_timeline_start = yield self.store.get_state_for_event(
|
state_at_timeline_start = yield self.store.get_state_for_event(
|
||||||
batch.events[0].event_id
|
batch.events[0].event_id
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue