Merge pull request #3027 from ikaven1024/fix-stop
stop proxy cache asynchronously
This commit is contained in:
commit
7c4d840885
|
@ -7,6 +7,7 @@ import (
|
|||
"sort"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
apierrors "k8s.io/apimachinery/pkg/api/errors"
|
||||
"k8s.io/apimachinery/pkg/api/meta"
|
||||
|
@ -57,6 +58,13 @@ func NewMultiClusterCache(newClientFunc func(string) (dynamic.Interface, error),
|
|||
|
||||
// UpdateCache update cache for multi clusters
|
||||
func (c *MultiClusterCache) UpdateCache(resourcesByCluster map[string]map[schema.GroupVersionResource]struct{}) error {
|
||||
if klog.V(3).Enabled() {
|
||||
start := time.Now()
|
||||
defer func() {
|
||||
klog.Infof("MultiClusterCache update cache takes %v", time.Since(start))
|
||||
}()
|
||||
}
|
||||
|
||||
c.lock.Lock()
|
||||
defer c.lock.Unlock()
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ type resourceCache struct {
|
|||
|
||||
func (c *resourceCache) stop() {
|
||||
klog.Infof("Stop store for %s %s", c.clusterName, c.resource)
|
||||
c.Store.DestroyFunc()
|
||||
go c.Store.DestroyFunc()
|
||||
}
|
||||
|
||||
func newResourceCache(clusterName string, gvr schema.GroupVersionResource, gvk schema.GroupVersionKind,
|
||||
|
|
Loading…
Reference in New Issue