Skip to content

Commit 4c18731

Browse files
committed
improve
1 parent e17c17d commit 4c18731

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

routers/web/repo/actions/view.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -279,12 +279,14 @@ func Rerun(ctx *context_module.Context) {
279279
return
280280
}
281281

282-
// reset run's start and stop time
283-
run.Started = 0
284-
run.Stopped = 0
285-
if err := actions_model.UpdateRun(ctx, run, "started", "stopped"); err != nil {
286-
ctx.Error(http.StatusInternalServerError, err.Error())
287-
return
282+
// reset run's start and stop time when it is done
283+
if run.Status.IsDone() {
284+
run.Started = 0
285+
run.Stopped = 0
286+
if err := actions_model.UpdateRun(ctx, run, "started", "stopped"); err != nil {
287+
ctx.Error(http.StatusInternalServerError, err.Error())
288+
return
289+
}
288290
}
289291

290292
job, jobs := getRunJobs(ctx, runIndex, jobIndex)

0 commit comments

Comments
 (0)