diff options
author | Neil Alexander <neilalexander@users.noreply.github.com> | 2022-03-03 16:45:06 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-03 16:45:06 +0000 |
commit | 5592322e13d0bf741130425079e37979f7637564 (patch) | |
tree | 10f52efd3a33f520085d643c1498c9407f9b969f /userapi/storage/interface.go | |
parent | c44029f269d0b17102dbbf31e50669c7c93fe50e (diff) |
Clean old notifications regularly (#2244)
* Clean old notifications regularly
We'll keep highlights for a month and non-highlights for a day, to stop the `userapi_notifications` table from growing indefinitely.
We'll also allow storing events even if no pushers are present, because apparently Element Web expects to work that way.
* Fix the milliseconds
* Use process context
* Update sytest lists
* Fix build issue
Diffstat (limited to 'userapi/storage/interface.go')
-rw-r--r-- | userapi/storage/interface.go | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/userapi/storage/interface.go b/userapi/storage/interface.go index 6d22fea9..77706710 100644 --- a/userapi/storage/interface.go +++ b/userapi/storage/interface.go @@ -97,6 +97,7 @@ type Database interface { GetNotifications(ctx context.Context, localpart string, fromID int64, limit int, filter tables.NotificationFilter) ([]*api.Notification, int64, error) GetNotificationCount(ctx context.Context, localpart string, filter tables.NotificationFilter) (int64, error) GetRoomNotificationCounts(ctx context.Context, localpart, roomID string) (total int64, highlight int64, _ error) + DeleteOldNotifications(ctx context.Context) error UpsertPusher(ctx context.Context, p api.Pusher, localpart string) error GetPushers(ctx context.Context, localpart string) ([]api.Pusher, error) |