mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-11 13:02:14 +00:00
Reset timer to zero when no progress notify was sent
This commit is contained in:
parent
544ea42482
commit
98e384fcd0
@ -95,15 +95,16 @@ func (pr *conditionalProgressRequester) Run(stopCh <-chan struct{}) {
|
|||||||
|
|
||||||
select {
|
select {
|
||||||
case <-timer.C():
|
case <-timer.C():
|
||||||
timer.Reset(progressRequestPeriod)
|
|
||||||
shouldRequest := func() bool {
|
shouldRequest := func() bool {
|
||||||
pr.mux.Lock()
|
pr.mux.Lock()
|
||||||
defer pr.mux.Unlock()
|
defer pr.mux.Unlock()
|
||||||
return pr.waiting > 0 && !pr.stopped
|
return pr.waiting > 0 && !pr.stopped
|
||||||
}()
|
}()
|
||||||
if !shouldRequest {
|
if !shouldRequest {
|
||||||
|
timer.Reset(0)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
timer.Reset(progressRequestPeriod)
|
||||||
err := pr.requestWatchProgress(ctx)
|
err := pr.requestWatchProgress(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
klog.V(4).InfoS("Error requesting bookmark", "err", err)
|
klog.V(4).InfoS("Error requesting bookmark", "err", err)
|
||||||
|
Loading…
Reference in New Issue
Block a user