From 66161bc8aeeb90d98e4b7207fce2da990d064f14 Mon Sep 17 00:00:00 2001 From: "Thibault \"bui\" Koechlin" Date: Mon, 20 Jul 2020 11:52:00 +0200 Subject: [PATCH] fix auto-delete (#140) --- pkg/database/commit.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/database/commit.go b/pkg/database/commit.go index 6fd8c6923..b034a4abf 100644 --- a/pkg/database/commit.go +++ b/pkg/database/commit.go @@ -48,7 +48,7 @@ func (c *Context) CleanUpRecordsByAge() error { //look for soft-deleted events that are OLDER than maxDurationRetention ret := c.Db.Unscoped().Table("ban_applications").Where("deleted_at is not NULL"). - Where("deleted_at > ?", time.Now().Add(-c.maxDurationRetention)). + Where("deleted_at < ?", time.Now().Add(-c.maxDurationRetention)). Order("updated_at desc").Find(&sos) if ret.Error != nil {