mirror of https://github.com/docker/compose.git
Merge pull request #1647 from gtardif/fix_race_depens_on
Avoid using for variable in go func, as this creates race conditions
This commit is contained in:
commit
c308e1f1b9
|
@ -147,6 +147,7 @@ func getContainerProgressName(container moby.Container) string {
|
||||||
func (s *composeService) waitDependencies(ctx context.Context, project *types.Project, service types.ServiceConfig) error {
|
func (s *composeService) waitDependencies(ctx context.Context, project *types.Project, service types.ServiceConfig) error {
|
||||||
eg, _ := errgroup.WithContext(ctx)
|
eg, _ := errgroup.WithContext(ctx)
|
||||||
for dep, config := range service.DependsOn {
|
for dep, config := range service.DependsOn {
|
||||||
|
dep, config := dep, config
|
||||||
eg.Go(func() error {
|
eg.Go(func() error {
|
||||||
ticker := time.NewTicker(500 * time.Millisecond)
|
ticker := time.NewTicker(500 * time.Millisecond)
|
||||||
defer ticker.Stop()
|
defer ticker.Stop()
|
||||||
|
|
Loading…
Reference in New Issue