Clobber old device list stream entries
This commit is contained in:
parent
e933a2712d
commit
3365117151
|
@ -546,6 +546,16 @@ class DeviceStore(SQLBaseStore):
|
||||||
host, stream_id,
|
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(
|
self._simple_insert_many_txn(
|
||||||
txn,
|
txn,
|
||||||
table="device_lists_stream",
|
table="device_lists_stream",
|
||||||
|
|
Loading…
Reference in New Issue