Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
synapse
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Maunium
synapse
Commits
9e696bd6
"src/git@mau.dev:june/conduwuit.git" did not exist on "32161801ed7fbbab5a2a3edf45db8c9fe10d1839"
Commit
9e696bd6
authored
9 years ago
by
Erik Johnston
Browse files
Options
Downloads
Patches
Plain Diff
Remove superfluous call to get_state_at when we already have an event for that stream position
parent
60bec240
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
synapse/handlers/sync.py
+12
-4
12 additions, 4 deletions
synapse/handlers/sync.py
with
12 additions
and
4 deletions
synapse/handlers/sync.py
+
12
−
4
View file @
9e696bd6
...
@@ -845,16 +845,20 @@ class SyncHandler(BaseHandler):
...
@@ -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):
...
@@ -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
)
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment