mirror of
https://github.com/aljazceru/lspd.git
synced 2025-12-19 14:54:22 +01:00
cleanup expired notification urls
This commit is contained in:
@@ -74,3 +74,16 @@ func (s *NotificationsStore) GetRegistrations(
|
||||
|
||||
return result, nil
|
||||
}
|
||||
|
||||
func (s *NotificationsStore) RemoveExpired(
|
||||
ctx context.Context,
|
||||
before time.Time,
|
||||
) error {
|
||||
_, err := s.pool.Exec(
|
||||
ctx,
|
||||
`DELETE FROM public.notification_subscriptions
|
||||
WHERE refreshed_at < $1`,
|
||||
before.UnixMicro())
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user