mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 17:30:00 +00:00
Remove dead variable from reflector
This commit is contained in:
parent
ea69570f61
commit
1c9e623045
6
pkg/client/cache/reflector.go
vendored
6
pkg/client/cache/reflector.go
vendored
@ -69,8 +69,6 @@ type Reflector struct {
|
|||||||
resyncPeriod time.Duration
|
resyncPeriod time.Duration
|
||||||
// now() returns current time - exposed for testing purposes
|
// now() returns current time - exposed for testing purposes
|
||||||
now func() time.Time
|
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
|
// lastSyncResourceVersion is the resource version token last
|
||||||
// observed when doing a sync with the underlying store
|
// observed when doing a sync with the underlying store
|
||||||
// it is thread safe, but not synchronized 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.
|
// required, and a cleanup function.
|
||||||
func (r *Reflector) resyncChan() (<-chan time.Time, func() bool) {
|
func (r *Reflector) resyncChan() (<-chan time.Time, func() bool) {
|
||||||
if r.resyncPeriod == 0 {
|
if r.resyncPeriod == 0 {
|
||||||
r.nextResync = time.Time{}
|
|
||||||
return neverExitWatch, func() bool { return false }
|
return neverExitWatch, func() bool { return false }
|
||||||
}
|
}
|
||||||
// The cleanup function is required: imagine the scenario where watches
|
// The cleanup function is required: imagine the scenario where watches
|
||||||
// always fail so we end up listing frequently. Then, if we don't
|
// 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
|
// manually stop the timer, we could end up with many timers active
|
||||||
// concurrently.
|
// concurrently.
|
||||||
r.nextResync = r.now().Add(r.resyncPeriod)
|
|
||||||
t := time.NewTimer(r.resyncPeriod)
|
t := time.NewTimer(r.resyncPeriod)
|
||||||
return t.C, t.Stop
|
return t.C, t.Stop
|
||||||
}
|
}
|
||||||
@ -285,7 +281,7 @@ func (r *Reflector) ListAndWatch(stopCh <-chan struct{}) error {
|
|||||||
case <-stopCh:
|
case <-stopCh:
|
||||||
return
|
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 {
|
if err := r.store.Resync(); err != nil {
|
||||||
resyncerrc <- err
|
resyncerrc <- err
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user