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
d28db583
Commit
d28db583
authored
8 years ago
by
Erik Johnston
Committed by
GitHub
8 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #2063 from matrix-org/erikj/device_list_batch
Batch sending of device list pokes
parents
dc56a6b8
2a28b79e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
synapse/federation/transaction_queue.py
+1
-0
1 addition, 0 deletions
synapse/federation/transaction_queue.py
synapse/storage/devices.py
+4
-0
4 additions, 0 deletions
synapse/storage/devices.py
with
5 additions
and
0 deletions
synapse/federation/transaction_queue.py
+
1
−
0
View file @
d28db583
...
...
@@ -309,6 +309,7 @@ class TransactionQueue(object):
# XXX: what's this for?
yield
run_on_reactor
()
pending_pdus
=
[]
while
True
:
device_message_edus
,
device_stream_id
,
dev_list_id
=
(
yield
self
.
_get_new_device_messages
(
destination
)
...
...
This diff is collapsed.
Click to expand it.
synapse/storage/devices.py
+
4
−
0
View file @
d28db583
...
...
@@ -329,6 +329,7 @@ class DeviceStore(SQLBaseStore):
SELECT user_id, device_id, max(stream_id) FROM device_lists_outbound_pokes
WHERE destination = ? AND ? < stream_id AND stream_id <= ? AND sent = ?
GROUP BY user_id, device_id
LIMIT 20
"""
txn
.
execute
(
sql
,
(
destination
,
from_stream_id
,
now_stream_id
,
False
)
...
...
@@ -339,6 +340,9 @@ class DeviceStore(SQLBaseStore):
if
not
query_map
:
return
(
now_stream_id
,
[])
if
len
(
query_map
)
>=
20
:
now_stream_id
=
max
(
stream_id
for
stream_id
in
query_map
.
itervalues
())
devices
=
self
.
_get_e2e_device_keys_txn
(
txn
,
query_map
.
keys
(),
include_all_devices
=
True
)
...
...
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