mirror of
https://github.com/kubernetes/client-go.git
synced 2025-09-04 08:35:10 +00:00
use build-in max and min func to instead of k8s.io/utils/integer funcs
Kubernetes-commit: eb8f3f194fed16484162aebdaab69168e02f8cb4
This commit is contained in:
committed by
Kubernetes Publisher
parent
12b0e099db
commit
c609c97b33
@@ -23,7 +23,6 @@ import (
|
|||||||
|
|
||||||
"k8s.io/utils/clock"
|
"k8s.io/utils/clock"
|
||||||
testingclock "k8s.io/utils/clock/testing"
|
testingclock "k8s.io/utils/clock/testing"
|
||||||
"k8s.io/utils/integer"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type backoffEntry struct {
|
type backoffEntry struct {
|
||||||
@@ -100,7 +99,7 @@ func (p *Backoff) Next(id string, eventTime time.Time) {
|
|||||||
} else {
|
} else {
|
||||||
delay := entry.backoff * 2 // exponential
|
delay := entry.backoff * 2 // exponential
|
||||||
delay += p.jitter(entry.backoff) // add some jitter to the delay
|
delay += p.jitter(entry.backoff) // add some jitter to the delay
|
||||||
entry.backoff = time.Duration(integer.Int64Min(int64(delay), int64(p.maxDuration)))
|
entry.backoff = min(delay, p.maxDuration)
|
||||||
}
|
}
|
||||||
entry.lastUpdate = p.Clock.Now()
|
entry.lastUpdate = p.Clock.Now()
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user