Skip to content

Commit 744f7c8

Browse files
authored
Skip deletion error for action artifacts (#33476) (#33568)
Fix #33567
1 parent da33b70 commit 744f7c8

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

services/actions/cleanup.go

+5-6
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ func cleanExpiredArtifacts(taskCtx context.Context) error {
5252
}
5353
if err := storage.ActionsArtifacts.Delete(artifact.StoragePath); err != nil {
5454
log.Error("Cannot delete artifact %d: %v", artifact.ID, err)
55-
continue
55+
// go on
5656
}
57-
log.Info("Artifact %d set expired", artifact.ID)
57+
log.Info("Artifact %d is deleted (due to expiration)", artifact.ID)
5858
}
5959
return nil
6060
}
@@ -76,9 +76,9 @@ func cleanNeedDeleteArtifacts(taskCtx context.Context) error {
7676
}
7777
if err := storage.ActionsArtifacts.Delete(artifact.StoragePath); err != nil {
7878
log.Error("Cannot delete artifact %d: %v", artifact.ID, err)
79-
continue
79+
// go on
8080
}
81-
log.Info("Artifact %d set deleted", artifact.ID)
81+
log.Info("Artifact %d is deleted (due to pending deletion)", artifact.ID)
8282
}
8383
if len(artifacts) < deleteArtifactBatchSize {
8484
log.Debug("No more artifacts pending deletion")
@@ -103,8 +103,7 @@ func CleanupLogs(ctx context.Context) error {
103103
for _, task := range tasks {
104104
if err := actions_module.RemoveLogs(ctx, task.LogInStorage, task.LogFilename); err != nil {
105105
log.Error("Failed to remove log %s (in storage %v) of task %v: %v", task.LogFilename, task.LogInStorage, task.ID, err)
106-
// do not return error here, continue to next task
107-
continue
106+
// do not return error here, go on
108107
}
109108
task.LogIndexes = nil // clear log indexes since it's a heavy field
110109
task.LogExpired = true

0 commit comments

Comments
 (0)