Commit 9233e5d7
9233e5d7244bMerged
Dmitriy Zhilyaev <[email protected]> ยท 4 years ago ยท 1 file ยท ~1 modified
Description
fix concurrent
Details
- Commit
- 9233e5d7244b
- Parent
- 21ad76d86763
pkg/plan/build_manifests.gomodifiedView file
@@ -2,16 +2,18 @@
22
33
import (44
"fmt"5-
65
"github.com/helmwave/helmwave/pkg/parallel"76
"github.com/helmwave/helmwave/pkg/release"87
log "github.com/sirupsen/logrus"8+
"sync"99
)1010
1111
func (p *Plan) buildManifest() error {1212
wg := parallel.NewWaitGroup()1313
wg.Add(len(p.body.Releases))1414
15+
mu := &sync.Mutex{}16+
1517
for _, rel := range p.body.Releases {1618
go func(wg *parallel.WaitGroup, rel *release.Config) {1719
defer wg.Done()@@ -42,7 +44,9 @@
4244
4345
log.Trace(document)4446
47+
mu.Lock()4548
p.manifests[rel.Uniq()] = document49+
mu.Unlock()4650
4751
log.Infof("โ
%s manifest done", rel.Uniq())4852
}(wg, rel)