@@ -427,8 +427,6 @@ func Rerun(ctx *context_module.Context) {
427427 return
428428 }
429429
430- var blockRunByConcurrency bool
431-
432430 // reset run's start and stop time when it is done
433431 if run .Status .IsDone () {
434432 run .PreviousDuration = run .Duration ()
@@ -473,11 +471,12 @@ func Rerun(ctx *context_module.Context) {
473471 notify_service .WorkflowRunStatusUpdate (ctx , run .Repo , run .TriggerUser , run )
474472 }
475473
474+ isRunBlocked := run .Status == actions_model .StatusBlocked
476475 if jobIndexStr == "" { // rerun all jobs
477476 for _ , j := range jobs {
478477 // if the job has needs, it should be set to "blocked" status to wait for other jobs
479- shouldBlock := len (j .Needs ) > 0 || blockRunByConcurrency
480- if err := rerunJob (ctx , j , shouldBlock ); err != nil {
478+ shouldBlockJob := len (j .Needs ) > 0 || isRunBlocked
479+ if err := rerunJob (ctx , j , shouldBlockJob ); err != nil {
481480 ctx .ServerError ("RerunJob" , err )
482481 return
483482 }
@@ -490,8 +489,8 @@ func Rerun(ctx *context_module.Context) {
490489
491490 for _ , j := range rerunJobs {
492491 // jobs other than the specified one should be set to "blocked" status
493- shouldBlock := j .JobID != job .JobID || blockRunByConcurrency
494- if err := rerunJob (ctx , j , shouldBlock ); err != nil {
492+ shouldBlockJob := j .JobID != job .JobID || isRunBlocked
493+ if err := rerunJob (ctx , j , shouldBlockJob ); err != nil {
495494 ctx .ServerError ("RerunJob" , err )
496495 return
497496 }
0 commit comments