Browse Source

fix auto-delete (#140)

Thibault "bui" Koechlin 5 years ago
parent
commit
66161bc8ae
1 changed files with 1 additions and 1 deletions
  1. 1 1
      pkg/database/commit.go

+ 1 - 1
pkg/database/commit.go

@@ -48,7 +48,7 @@ func (c *Context) CleanUpRecordsByAge() error {
 
 
 	//look for soft-deleted events that are OLDER than maxDurationRetention
 	//look for soft-deleted events that are OLDER than maxDurationRetention
 	ret := c.Db.Unscoped().Table("ban_applications").Where("deleted_at is not NULL").
 	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)
 		Order("updated_at desc").Find(&sos)
 
 
 	if ret.Error != nil {
 	if ret.Error != nil {