|
@@ -252,14 +252,14 @@ func NewFromConfig(config *factory.Config) *Scheduler {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-var timeout *time.Ticker
|
|
|
+//var timeout *time.Ticker
|
|
|
|
|
|
// Run begins watching and scheduling. It waits for cache to be synced, then starts a goroutine and returns immediately.
|
|
|
func (sched *Scheduler) Run() {
|
|
|
if !sched.config.WaitForCacheSync() {
|
|
|
return
|
|
|
}
|
|
|
- timeout = time.NewTicker(time.Duration(10 * time.Second))
|
|
|
+ //customcache.Timeout := time.NewTicker(time.Duration(10 * time.Second))
|
|
|
go wait.Until(sched.scheduleOne, 0, sched.config.StopEverything)
|
|
|
}
|
|
|
|
|
@@ -448,7 +448,7 @@ func (sched *Scheduler) scheduleOne() {
|
|
|
// Check if the cache needs update
|
|
|
select {
|
|
|
// clean the cache if 10 seconds are passed
|
|
|
- case <-timeout.C:
|
|
|
+ case <-customcache.labCache.Timeout.C:
|
|
|
klog.Infof("Time to erase")
|
|
|
customcache.LabCache.CleanCache()
|
|
|
default:
|