Skip to content

Commit

Permalink
style: delete duplicate error check in artifacttrash dao (#20557)
Browse files Browse the repository at this point in the history
Signed-off-by: chlins <chlins.zhang@gmail.com>
  • Loading branch information
Chlins Zhang committed Jun 12, 2024
1 parent 1c9cb2e commit 6a38ed3
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/pkg/artifactrash/dao/dao.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6a38ed3

Please sign in to comment.