mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-04 18:00:08 +00:00
bugfix: panic log params in the construct method when maxInterval is less than minInterval
This commit is contained in:
parent
4ac81d7508
commit
76aceca22f
@ -140,7 +140,7 @@ func NewBoundedFrequencyRunner(name string, fn func(), minInterval, maxInterval
|
|||||||
// Make an instance with dependencies injected.
|
// Make an instance with dependencies injected.
|
||||||
func construct(name string, fn func(), minInterval, maxInterval time.Duration, burstRuns int, timer timer) *BoundedFrequencyRunner {
|
func construct(name string, fn func(), minInterval, maxInterval time.Duration, burstRuns int, timer timer) *BoundedFrequencyRunner {
|
||||||
if maxInterval < minInterval {
|
if maxInterval < minInterval {
|
||||||
panic(fmt.Sprintf("%s: maxInterval (%v) must be >= minInterval (%v)", name, minInterval, maxInterval))
|
panic(fmt.Sprintf("%s: maxInterval (%v) must be >= minInterval (%v)", name, maxInterval, minInterval))
|
||||||
}
|
}
|
||||||
if timer == nil {
|
if timer == nil {
|
||||||
panic(fmt.Sprintf("%s: timer must be non-nil", name))
|
panic(fmt.Sprintf("%s: timer must be non-nil", name))
|
||||||
|
Loading…
Reference in New Issue
Block a user