Skip to content
Snippets Groups Projects
Commit 33651171 authored by Erik Johnston's avatar Erik Johnston
Browse files

Clobber old device list stream entries

parent e933a271
No related branches found
No related tags found
No related merge requests found
......@@ -546,6 +546,16 @@ class DeviceStore(SQLBaseStore):
host, stream_id,
)
# Delete older entries in the table, as we really only care about
# when the latest change happened.
txn.executemany(
"""
DELETE FROM device_lists_stream
WHERE user_id = ? AND device_id = ? AND stream_id < ?
""",
[(user_id, device_id, stream_id) for device_id in device_ids]
)
self._simple_insert_many_txn(
txn,
table="device_lists_stream",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment