Skip to content

Commit

Permalink
fix wg
Browse files Browse the repository at this point in the history
  • Loading branch information
ying-zhu committed Oct 6, 2022
1 parent 635eafe commit 2983bc4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pilot/pkg/model/push_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -1666,6 +1666,7 @@ func (ps *PushContext) initSidecarScopes(env *Environment) error {

ch := make(chan *SidecarScope)
var wg sync.WaitGroup
wg.Add(len(sidecarConfigs))
for _, sidecarConfig := range sidecarConfigs {
go func(c config.Config) {
defer wg.Done()
Expand All @@ -1681,7 +1682,7 @@ func (ps *PushContext) initSidecarScopes(env *Environment) error {
for sidecarScope := range ch {
ps.sidecarIndex.sidecarsByNamespace[sidecarScope.Namespace] = append(ps.sidecarIndex.sidecarsByNamespace[sidecarScope.Namespace], sidecarScope)
}

log.Infof("[Ying] populate sidecarIndex took %v seconds", time.Since(t))

return nil
Expand Down

0 comments on commit 2983bc4

Please sign in to comment.