Skip to content

Commit 6f28db5

Browse files
committed
improve
1 parent e17c17d commit 6f28db5

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

routers/web/repo/actions/view.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -280,11 +280,13 @@ func Rerun(ctx *context_module.Context) {
280280
}
281281

282282
// 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
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)