aboutsummaryrefslogtreecommitdiff
path: root/userapi
diff options
context:
space:
mode:
authorNeil Alexander <neilalexander@users.noreply.github.com>2022-09-09 12:59:28 +0100
committerNeil Alexander <neilalexander@users.noreply.github.com>2022-09-09 12:59:28 +0100
commit34e1dc210bf4698d2b46a0be71e6dfc10a5a6365 (patch)
treea60323c73083353aca2bbab8efc2d9f7ba754fdf /userapi
parent64472d9aab85bf56fb345570459c372b78a14b8c (diff)
Use database writer in user API `DeleteOldNotifications`
Diffstat (limited to 'userapi')
-rw-r--r--userapi/storage/shared/storage.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/userapi/storage/shared/storage.go b/userapi/storage/shared/storage.go
index d968b47a..acc65212 100644
--- a/userapi/storage/shared/storage.go
+++ b/userapi/storage/shared/storage.go
@@ -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(