style: delete duplicate error check in artifacttrash dao (#20557)

Signed-off-by: chlins <chlins.zhang@gmail.com>
This commit is contained in:
Chlins Zhang 2024-06-12 18:16:55 +08:00 committed by GitHub
parent 1c9cb2e253
commit 6a38ed3d77
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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