aboutsummaryrefslogtreecommitdiffstats
path: root/services/actions/clear_tasks.go
diff options
context:
space:
mode:
Diffstat (limited to 'services/actions/clear_tasks.go')
-rw-r--r--services/actions/clear_tasks.go16
1 files changed, 12 insertions, 4 deletions
diff --git a/services/actions/clear_tasks.go b/services/actions/clear_tasks.go
index 0616a5fc0d..d2893e4f23 100644
--- a/services/actions/clear_tasks.go
+++ b/services/actions/clear_tasks.go
@@ -56,12 +56,20 @@ func stopTasks(ctx context.Context, opts actions_model.FindTaskOptions) error {
return nil
}); err != nil {
log.Warn("Cannot stop task %v: %v", task.ID, err)
- // go on
- } else if remove, err := actions.TransferLogs(ctx, task.LogFilename); err != nil {
+ continue
+ }
+
+ remove, err := actions.TransferLogs(ctx, task.LogFilename)
+ if err != nil {
log.Warn("Cannot transfer logs of task %v: %v", task.ID, err)
- } else {
- remove()
+ continue
+ }
+ task.LogInStorage = true
+ if err := actions_model.UpdateTask(ctx, task, "log_in_storage"); err != nil {
+ log.Warn("Cannot update task %v: %v", task.ID, err)
+ continue
}
+ remove()
}
CreateCommitStatus(ctx, jobs...)