call WaitGroup.Done() at the right time
Signed-off-by: Inteon <42113979+inteon@users.noreply.github.com>
This commit is contained in:
parent
9ad9e220f3
commit
81aa09cd88
@ -107,12 +107,12 @@ func (c *controller) Run(workers int, stopCh <-chan struct{}) error {
|
||||
|
||||
var wg sync.WaitGroup
|
||||
for i := 0; i < workers; i++ {
|
||||
wg.Add(1)
|
||||
// TODO (@munnerz): make time.Second duration configurable
|
||||
go wait.Until(func() {
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
c.worker(ctx)
|
||||
}, time.Second, stopCh)
|
||||
wait.Until(func() { c.worker(ctx) }, time.Second, stopCh)
|
||||
}()
|
||||
}
|
||||
|
||||
for _, f := range c.runFirstFuncs {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user