Skip to content
This repository was archived by the owner on Mar 26, 2024. It is now read-only.

Commit 90878d6

Browse files
committed
Remove aggregated rows after aggregation process
1 parent 47eccd0 commit 90878d6

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

synapse/storage/databases/main/beeper.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,13 +217,15 @@ def aggregate_txn(txn: LoggingTransaction) -> None:
217217
txn.execute(sql)
218218
orders = list(txn)
219219
if not orders:
220+
logger.info("No user counts aggregated")
220221
return
221222

222223
max_stream_ordering = max(orders)
223224
txn.execute(
224225
"UPDATE beeper_user_notification_counts_stream_ordering SET stream_ordering = ?",
225226
max_stream_ordering,
226227
)
228+
txn.execute("DELETE FROM beeper_user_notification_counts WHERE aggregated")
227229

228230
logger.info(f"Aggregated {len(orders)} notification count rows")
229231

0 commit comments

Comments
 (0)