fix: stop informer manager Instance once
Signed-off-by: yvoilee <yvoilee@gmail.com>
This commit is contained in:
parent
943733b6a7
commit
f698881e1f
|
@ -11,6 +11,7 @@ import (
|
||||||
var (
|
var (
|
||||||
instance MultiClusterInformerManager
|
instance MultiClusterInformerManager
|
||||||
once sync.Once
|
once sync.Once
|
||||||
|
stopOnce sync.Once
|
||||||
stopCh chan struct{}
|
stopCh chan struct{}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -28,7 +29,7 @@ func GetInstance() MultiClusterInformerManager {
|
||||||
|
|
||||||
// StopInstance will stop the shared MultiClusterInformerManager instance.
|
// StopInstance will stop the shared MultiClusterInformerManager instance.
|
||||||
func StopInstance() {
|
func StopInstance() {
|
||||||
once.Do(func() {
|
stopOnce.Do(func() {
|
||||||
close(stopCh)
|
close(stopCh)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue