diff options
Diffstat (limited to 'routers/web/repo/actions/view.go')
-rw-r--r-- | routers/web/repo/actions/view.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/routers/web/repo/actions/view.go b/routers/web/repo/actions/view.go index 1cdae32a32..9cda30d23d 100644 --- a/routers/web/repo/actions/view.go +++ b/routers/web/repo/actions/view.go @@ -279,6 +279,17 @@ func Rerun(ctx *context_module.Context) { return } + // reset run's start and stop time when it is done + if run.Status.IsDone() { + run.PreviousDuration = run.Duration() + run.Started = 0 + run.Stopped = 0 + if err := actions_model.UpdateRun(ctx, run, "started", "stopped", "previous_duration"); err != nil { + ctx.Error(http.StatusInternalServerError, err.Error()) + return + } + } + job, jobs := getRunJobs(ctx, runIndex, jobIndex) if ctx.Written() { return |