瀏覽代碼

fix sql query

Thibault bui Koechlin 5 年之前
父節點
當前提交
625e908894
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      pkg/sqlite/commit.go

+ 1 - 1
pkg/sqlite/commit.go

@@ -46,7 +46,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(fmt.Sprintf("deleted_at > data('now','-%d minutes')", int(c.maxDurationRetention.Minutes()))).
+		Where(fmt.Sprintf("deleted_at > date('now','-%d minutes')", int(c.maxDurationRetention.Minutes()))).
 		Order("updated_at desc").Find(&sos)
 
 	if ret.Error != nil {