Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ying-zhu committed Oct 21, 2022
1 parent 83b9d98 commit c02b655
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions pilot/pkg/model/push_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -1675,16 +1675,17 @@ func (ps *PushContext) initSidecarScopes(env *Environment, wp *PushContextWorker
n := len(sidecarConfigs)
var wg sync.WaitGroup
wg.Add(n)
for i := 0; i < n; i++ {
work := func() {
defer wg.Done()
c := sidecarConfigs[i]
ch <- ConvertToSidecarScope(ps, &c, c.Namespace)
}
wp.PushWork(work)
}

go func() {
for i := 0; i < n; i++ {
work := func() {
defer wg.Done()
c := sidecarConfigs[i]
ch <- ConvertToSidecarScope(ps, &c, c.Namespace)
}
wp.PushWork(work)
}

wg.Wait()
close(ch)
}()
Expand Down

0 comments on commit c02b655

Please sign in to comment.