|
@@ -40,6 +40,8 @@ import (
|
|
|
"k8s.io/kubernetes/pkg/scheduler/core"
|
|
|
|
|
|
// "k8s.io/kubernetes/pkg/scheduler/customcache"
|
|
|
+ "github.com/iwita/kube-scheduler/customcache"
|
|
|
+
|
|
|
"k8s.io/kubernetes/pkg/scheduler/factory"
|
|
|
framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
|
|
|
internalcache "k8s.io/kubernetes/pkg/scheduler/internal/cache"
|
|
@@ -454,17 +456,17 @@ func (sched *Scheduler) scheduleOne() {
|
|
|
// default:
|
|
|
// }
|
|
|
|
|
|
- // Check if the cache needs update
|
|
|
- //klog.Infof("The value of the Ticker: %v", customcache.LabCache.Timeout.C)
|
|
|
- // select {
|
|
|
- // // clean the cache if 10 seconds are passed
|
|
|
- // case <-customcache.LabCache.Timeout.C:
|
|
|
- // klog.Infof("Time to erase: %v", time.Now())
|
|
|
- // //customcache.LabCache.Timeout.Stop()
|
|
|
- // customcache.LabCache.CleanCache()
|
|
|
- // klog.Infof("Cache: %v", customcache.LabCache.Cache)
|
|
|
- // default:
|
|
|
- // }
|
|
|
+ //Check if the cache needs update
|
|
|
+ klog.Infof("The value of the Ticker: %v", customcache.LabCache.Timeout.C)
|
|
|
+ select {
|
|
|
+ // clean the cache if 10 seconds are passed
|
|
|
+ case <-customcache.LabCache.Timeout.C:
|
|
|
+ klog.Infof("Time to erase: %v", time.Now())
|
|
|
+ //customcache.LabCache.Timeout.Stop()
|
|
|
+ customcache.LabCache.CleanCache()
|
|
|
+ klog.Infof("Cache: %v", customcache.LabCache.Cache)
|
|
|
+ default:
|
|
|
+ }
|
|
|
|
|
|
fwk := sched.config.Framework
|
|
|
|