diff --git a/database/controller.go b/database/controller.go index 902d7fc..415e22d 100644 --- a/database/controller.go +++ b/database/controller.go @@ -280,6 +280,7 @@ func (c *Controller) MaintainRecordStates(ctx context.Context, purgeDeletedBefor return c.storage.MaintainRecordStates(ctx, purgeDeletedBefore) } +// Purge deletes all records that match the given query. It returns the number of successful deletes and an error. func (c *Controller) Purge(ctx context.Context, q *query.Query, local, internal bool) (int, error) { c.writeLock.RLock() defer c.writeLock.RUnlock() diff --git a/database/storage/bbolt/bbolt.go b/database/storage/bbolt/bbolt.go index ca88864..34a281e 100644 --- a/database/storage/bbolt/bbolt.go +++ b/database/storage/bbolt/bbolt.go @@ -298,7 +298,7 @@ func (b *BBolt) MaintainRecordStates(ctx context.Context, purgeDeletedBefore tim } // Purge deletes all records that match the given query. It returns the number of successful deletes and an error. -func (b *BBolt) Purge(ctx context.Context, q *query.Query, local, internal, shadowDelete bool) (int, error) { +func (b *BBolt) Purge(ctx context.Context, q *query.Query, local, internal, shadowDelete bool) (int, error) { //nolint:gocognit prefix := []byte(q.DatabaseKeyPrefix()) var cnt int