Skip to content

Commit 197e635

Browse files
committed
Fix deadlock in WithServicesTransform
Signed-off-by: Nicolas De Loof <[email protected]>
1 parent 3b30ce3 commit 197e635

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

types/project.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -659,12 +659,12 @@ func (p *Project) WithServicesTransform(fn func(name string, s ServiceConfig) (S
659659
name string
660660
service ServiceConfig
661661
}
662-
resultCh := make(chan result)
662+
expect := len(p.Services)
663+
resultCh := make(chan result, expect)
663664
newProject := p.deepCopy()
664665

665666
eg, ctx := errgroup.WithContext(context.Background())
666667
eg.Go(func() error {
667-
expect := len(newProject.Services)
668668
s := Services{}
669669
for expect > 0 {
670670
select {

0 commit comments

Comments
 (0)