mirror of
https://github.com/element-hq/synapse.git
synced 2024-11-26 03:25:53 +03:00
Move deletion from table inside txn
This commit is contained in:
parent
04710cc2d7
commit
e2c46ed851
1 changed files with 5 additions and 2 deletions
|
@ -254,10 +254,13 @@ class StatsStore(StateDeltasStore):
|
||||||
{"room_id": room_id, "token": current_token},
|
{"room_id": room_id, "token": current_token},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# We've finished a room. Delete it from the table.
|
||||||
|
self._simple_delete_one_txn(
|
||||||
|
txn, TEMP_TABLE + "_rooms", {"room_id": room_id},
|
||||||
|
)
|
||||||
|
|
||||||
yield self.runInteraction("update_room_stats", _fetch_data)
|
yield self.runInteraction("update_room_stats", _fetch_data)
|
||||||
|
|
||||||
# We've finished a room. Delete it from the table.
|
|
||||||
yield self._simple_delete_one(TEMP_TABLE + "_rooms", {"room_id": room_id})
|
|
||||||
# Update the remaining counter.
|
# Update the remaining counter.
|
||||||
progress["remaining"] -= 1
|
progress["remaining"] -= 1
|
||||||
yield self.runInteraction(
|
yield self.runInteraction(
|
||||||
|
|
Loading…
Reference in a new issue