mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-15 14:14:39 +00:00
defer Done call
safer in case of panic
This commit is contained in:
@@ -185,8 +185,8 @@ func (c *controller[T]) Run(ctx context.Context) error {
|
|||||||
for i := uint(0); i < c.options.Workers; i++ {
|
for i := uint(0); i < c.options.Workers; i++ {
|
||||||
waitGroup.Add(1)
|
waitGroup.Add(1)
|
||||||
go func() {
|
go func() {
|
||||||
|
defer waitGroup.Done()
|
||||||
wait.Until(c.runWorker, time.Second, ctx.Done())
|
wait.Until(c.runWorker, time.Second, ctx.Done())
|
||||||
waitGroup.Done()
|
|
||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user