Skip to content

Commit 487c1cd

Browse files
committed
Limite le parallélisme
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
1 parent adf39f8 commit 487c1cd

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

pkg/compose/plan_executor.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,11 @@ func (s *composeService) ExecutePlan(ctx context.Context, project *types.Project
178178

179179
expect := len(plan.Operations)
180180
eg, ctx := errgroup.WithContext(ctx)
181+
if s.maxConcurrency > 0 {
182+
// +1 to reserve a slot for the consumer goroutine that schedules
183+
// dependent operations, same pattern as graphTraversal.visit().
184+
eg.SetLimit(s.maxConcurrency + 1)
185+
}
181186
opCh := make(chan *Operation, expect)
182187

183188
// sendDone sends a completed operation to the consumer goroutine,

0 commit comments

Comments
 (0)