simplify waitForCacheSync func

Signed-off-by: carlory <baofa.fan@daocloud.io>
This commit is contained in:
carlory 2021-12-25 17:15:42 +08:00
parent 026458d18e
commit 572bf7ec4c
1 changed files with 1 additions and 9 deletions

View File

@ -193,15 +193,7 @@ func (es *AccurateSchedulerEstimatorServer) nodeMaxAvailableReplica(node *corev1
}
func (es *AccurateSchedulerEstimatorServer) waitForCacheSync(stopCh <-chan struct{}) bool {
return cache.WaitForCacheSync(stopCh,
func() []cache.InformerSynced {
informerSynced := []cache.InformerSynced{
es.podInformer.Informer().HasSynced,
es.nodeInformer.Informer().HasSynced,
}
return informerSynced
}()...,
)
return cache.WaitForCacheSync(stopCh, es.podInformer.Informer().HasSynced, es.nodeInformer.Informer().HasSynced)
}
func traceMaxAvailableReplicas(object string, start time.Time, request *pb.MaxAvailableReplicasRequest) func(response **pb.MaxAvailableReplicasResponse, err *error) {