From 6a38ed3d7769e3598c6cf829aae4e0e152f93a83 Mon Sep 17 00:00:00 2001 From: Chlins Zhang Date: Wed, 12 Jun 2024 18:16:55 +0800 Subject: [PATCH] style: delete duplicate error check in artifacttrash dao (#20557) Signed-off-by: chlins --- src/pkg/artifactrash/dao/dao.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/pkg/artifactrash/dao/dao.go b/src/pkg/artifactrash/dao/dao.go index 918254cacc8..f10beba4f42 100644 --- a/src/pkg/artifactrash/dao/dao.go +++ b/src/pkg/artifactrash/dao/dao.go @@ -102,10 +102,8 @@ func (d *dao) Flush(ctx context.Context, cutOff time.Time) (err error) { if err != nil { return err } + sql := fmt.Sprintf(`DELETE FROM artifact_trash where creation_time <= TO_TIMESTAMP('%f')`, float64(cutOff.UnixNano())/float64((time.Second))) - if err != nil { - return err - } _, err = ormer.Raw(sql).Exec() if err != nil { return err