From 1c9e6230459e62e7c0ef5db3505fd2f0f14f2d35 Mon Sep 17 00:00:00 2001 From: Wojciech Tyczynski Date: Tue, 9 Aug 2016 15:39:27 +0200 Subject: [PATCH] Remove dead variable from reflector --- pkg/client/cache/reflector.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/pkg/client/cache/reflector.go b/pkg/client/cache/reflector.go index 7e6adf404a..0f6e3681f9 100644 --- a/pkg/client/cache/reflector.go +++ b/pkg/client/cache/reflector.go @@ -69,8 +69,6 @@ type Reflector struct { resyncPeriod time.Duration // now() returns current time - exposed for testing purposes now func() time.Time - // nextResync is approximate time of next resync (0 if not scheduled) - nextResync time.Time // lastSyncResourceVersion is the resource version token last // observed when doing a sync with the underlying store // it is thread safe, but not synchronized with the underlying store @@ -234,14 +232,12 @@ var ( // required, and a cleanup function. func (r *Reflector) resyncChan() (<-chan time.Time, func() bool) { if r.resyncPeriod == 0 { - r.nextResync = time.Time{} return neverExitWatch, func() bool { return false } } // The cleanup function is required: imagine the scenario where watches // always fail so we end up listing frequently. Then, if we don't // manually stop the timer, we could end up with many timers active // concurrently. - r.nextResync = r.now().Add(r.resyncPeriod) t := time.NewTimer(r.resyncPeriod) return t.C, t.Stop } @@ -285,7 +281,7 @@ func (r *Reflector) ListAndWatch(stopCh <-chan struct{}) error { case <-stopCh: return } - glog.V(4).Infof("%s: next resync planned for %#v, forcing now", r.name, r.nextResync) + glog.V(4).Infof("%s: forcing resync", r.name) if err := r.store.Resync(); err != nil { resyncerrc <- err return