Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Matrix
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Operate
Environments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Matrix
Commits
ec2cb9f2
Unverified
Commit
ec2cb9f2
authored
5 years ago
by
Brendan Abolivier
Browse files
Options
Downloads
Patches
Plain Diff
Initialise value before looping
parent
bb78276b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
synapse/storage/data_stores/main/events_bg_updates.py
+8
-4
8 additions, 4 deletions
synapse/storage/data_stores/main/events_bg_updates.py
with
8 additions
and
4 deletions
synapse/storage/data_stores/main/events_bg_updates.py
+
8
−
4
View file @
ec2cb9f2
...
...
@@ -526,28 +526,32 @@ class EventsBackgroundUpdatesStore(BackgroundUpdateStore):
)
nbrows
=
0
for
(
event_id
,
event_json
)
in
txn
:
last_row_event_id
=
""
for
(
event_id
,
event_json_raw
)
in
txn
:
event_json
=
json
.
loads
(
event_json_raw
)
self
.
_simple_insert_many_txn
(
txn
=
txn
,
table
=
"
event_labels
"
,
values
=
[
{
"
event_id
"
:
event_id
,
"
label
"
:
str
(
label
)
,
"
label
"
:
label
,
"
room_id
"
:
event_json
[
"
room_id
"
],
"
topological_ordering
"
:
event_json
[
"
depth
"
],
}
for
label
in
event_json
[
"
content
"
].
get
(
EventContentFields
.
LABELS
,
[]
)
if
label
is
not
None
if
label
is
not
None
and
isinstance
(
label
,
str
)
],
)
nbrows
+=
1
last_row_event_id
=
event_id
self
.
_background_update_progress_txn
(
txn
,
"
event_store_labels
"
,
{
"
last_event_id
"
:
event_id
}
txn
,
"
event_store_labels
"
,
{
"
last_event_id
"
:
last_row_
event_id
}
)
return
nbrows
...
...
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