diff options
author | Erik Johnston <erikj@jki.re> | 2017-03-28 11:35:41 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-28 11:35:41 +0100 |
commit | d28db583dacc76dd6423410225072db1d5a66807 (patch) | |
tree | 12d857a464d7b7a8c57f262e56eedb529b071c99 /synapse/storage | |
parent | Merge pull request #2070 from matrix-org/erikj/perf_send (diff) | |
parent | Batch sending of device list pokes (diff) | |
download | synapse-d28db583dacc76dd6423410225072db1d5a66807.tar.xz |
Merge pull request #2063 from matrix-org/erikj/device_list_batch
Batch sending of device list pokes
Diffstat (limited to 'synapse/storage')
-rw-r--r-- | synapse/storage/devices.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/synapse/storage/devices.py b/synapse/storage/devices.py index 6beeff8b00..53e36791d5 100644 --- a/synapse/storage/devices.py +++ b/synapse/storage/devices.py @@ -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 ) |