Use database writer in user API DeleteOldNotifications

This commit is contained in:
Neil Alexander 2022-09-09 12:59:28 +01:00 committed by 0x1a8510f2
parent 53692fcbb2
commit 3fa6af07e3
No known key found for this signature in database
GPG key ID: 1C692E355D76775D

View file

@ -735,7 +735,9 @@ func (d *Database) GetRoomNotificationCounts(ctx context.Context, localpart, roo
}
func (d *Database) DeleteOldNotifications(ctx context.Context) error {
return d.Notifications.Clean(ctx, nil)
return d.Writer.Do(d.DB, nil, func(txn *sql.Tx) error {
return d.Notifications.Clean(ctx, txn)
})
}
func (d *Database) UpsertPusher(