File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -373,14 +373,15 @@ func ShouldBlockRunByConcurrency(ctx context.Context, actionRun *ActionRun) (boo
373373 return false , nil
374374 }
375375
376- concurrentRunsNum , err := db .Count [ActionRun ](ctx , & FindRunOptions {
376+ concurrentRuns , err := db .Find [ActionRun ](ctx , & FindRunOptions {
377377 RepoID : actionRun .RepoID ,
378378 ConcurrencyGroup : actionRun .ConcurrencyGroup ,
379379 Status : []Status {StatusWaiting , StatusRunning },
380380 })
381381 if err != nil {
382- return false , fmt .Errorf ("count running and waiting runs: %w" , err )
382+ return false , fmt .Errorf ("find running and waiting runs: %w" , err )
383383 }
384+ previousRuns := slices .DeleteFunc (concurrentRuns , func (r * ActionRun ) bool { return r .ID == actionRun .ID })
384385
385- return concurrentRunsNum > 0 , nil
386+ return len ( previousRuns ) > 0 , nil
386387}
You can’t perform that action at this time.
0 commit comments