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
f7e4a582
Commit
f7e4a582
authored
5 years ago
by
Hubert Chathi
Browse files
Options
Downloads
Patches
Plain Diff
clean up code a bit
parent
998f7fe7
No related branches found
No related tags found
Loading
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
synapse/replication/slave/storage/devices.py
+9
-5
9 additions, 5 deletions
synapse/replication/slave/storage/devices.py
with
9 additions
and
5 deletions
synapse/replication/slave/storage/devices.py
+
9
−
5
View file @
f7e4a582
...
...
@@ -15,6 +15,7 @@
from
synapse.replication.slave.storage._base
import
BaseSlavedStore
from
synapse.replication.slave.storage._slaved_id_tracker
import
SlavedIdTracker
from
synapse.replication.tcp.streams._base
import
DeviceListsStream
,
UserSignatureStream
from
synapse.storage.data_stores.main.devices
import
DeviceWorkerStore
from
synapse.storage.data_stores.main.end_to_end_keys
import
EndToEndKeyWorkerStore
from
synapse.util.caches.stream_change_cache
import
StreamChangeCache
...
...
@@ -42,17 +43,20 @@ class SlavedDeviceStore(EndToEndKeyWorkerStore, DeviceWorkerStore, BaseSlavedSto
def
stream_positions
(
self
):
result
=
super
(
SlavedDeviceStore
,
self
).
stream_positions
()
result
[
"
user_signature
"
]
=
result
[
"
device_lists
"
]
=
self
.
_device_list_id_gen
.
get_current_token
()
# The user signature stream uses the same stream ID generator as the
# device list stream, so set them both to the device list ID
# generator's current token.
current_token
=
self
.
_device_list_id_gen
.
get_current_token
()
result
[
DeviceListsStream
.
NAME
]
=
current_token
result
[
UserSignatureStream
.
NAME
]
=
current_token
return
result
def
process_replication_rows
(
self
,
stream_name
,
token
,
rows
):
if
stream_name
==
"
d
evice
_l
ists
"
:
if
stream_name
==
D
evice
L
ists
Stream
.
NAME
:
self
.
_device_list_id_gen
.
advance
(
token
)
for
row
in
rows
:
self
.
_invalidate_caches_for_devices
(
token
,
row
.
user_id
,
row
.
destination
)
elif
stream_name
==
"
u
ser
_s
ignature
"
:
elif
stream_name
==
U
ser
S
ignature
Stream
.
NAME
:
for
row
in
rows
:
self
.
_user_signature_stream_cache
.
entity_has_changed
(
row
.
user_id
,
token
)
return
super
(
SlavedDeviceStore
,
self
).
process_replication_rows
(
...
...
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