Skip to content

Commit b231cf3

Browse files
committed
fixes
1 parent f61e5bb commit b231cf3

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

models/actions/run.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -303,15 +303,15 @@ func InsertRun(ctx context.Context, run *ActionRun, runJobs []*ActionRunJob) err
303303
return err
304304
}
305305
} else {
306-
waitingConcurrentRunsNum, err := db.Count[ActionRun](ctx, &FindRunOptions{
306+
runningConcurrentRunsNum, err := db.Count[ActionRun](ctx, &FindRunOptions{
307307
RepoID: run.RepoID,
308308
ConcurrencyGroup: run.ConcurrencyGroup,
309-
Status: []Status{StatusWaiting},
309+
Status: []Status{StatusRunning},
310310
})
311311
if err != nil {
312312
return err
313313
}
314-
blockedByWorkflowConcurrency = waitingConcurrentRunsNum > 0
314+
blockedByWorkflowConcurrency = runningConcurrentRunsNum > 0
315315
}
316316
}
317317
if blockedByWorkflowConcurrency {
@@ -336,6 +336,7 @@ func InsertRun(ctx context.Context, run *ActionRun, runJobs []*ActionRunJob) err
336336

337337
var hasWaiting bool
338338
for _, job := range runJobs {
339+
job.RunID = run.ID
339340
if job.Status != StatusBlocked {
340341
if blockedByWorkflowConcurrency {
341342
// the job should also be blocked when the run is blocked

services/actions/concurrency.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ func PrepareConcurrencyForRunAndJobs(ctx context.Context, wfContent []byte, run
5050
}
5151
job.Name, _ = util.SplitStringAtByteN(job.Name, 255)
5252
runJob := &actions_model.ActionRunJob{
53-
RunID: run.ID,
5453
RepoID: run.RepoID,
5554
OwnerID: run.OwnerID,
5655
CommitSHA: run.CommitSHA,

0 commit comments

Comments
 (0)