Skip to content

Commit fb99bd0

Browse files
committed
simplify worker loop
Signed-off-by: Dmitry Shmulevich <[email protected]>
1 parent cf24119 commit fb99bd0

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

pkg/node_observer/status_informer.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,10 @@ package node_observer
77

88
import (
99
"context"
10-
"time"
1110

1211
corev1 "k8s.io/api/core/v1"
1312
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1413
"k8s.io/apimachinery/pkg/labels"
15-
"k8s.io/apimachinery/pkg/util/wait"
1614
"k8s.io/client-go/informers"
1715
"k8s.io/client-go/kubernetes"
1816
"k8s.io/client-go/tools/cache"
@@ -78,10 +76,10 @@ func (s *StatusInformer) Start() error {
7876
return err
7977
}
8078

81-
go wait.Until(func() {
79+
go func() {
8280
for s.processEvent() {
8381
}
84-
}, time.Second, s.ctx.Done())
82+
}()
8583

8684
return nil
8785
}
@@ -181,8 +179,8 @@ func (s *StatusInformer) startPodInformer() error {
181179
}
182180

183181
func (s *StatusInformer) processEvent() bool {
184-
item, quit := s.queue.Get()
185-
if quit {
182+
item, shutdown := s.queue.Get()
183+
if shutdown {
186184
return false
187185
}
188186
defer s.queue.Done(item)

0 commit comments

Comments
 (0)