mirror of
https://github.com/projectcapsule/capsule.git
synced 2026-08-19 20:46:42 +00:00
* feat: implement performance optimizations --------- Signed-off-by: Oliver Baehler <oliver@sudo-i.net>
19 lines
290 B
Go
19 lines
290 B
Go
// Copyright 2020-2026 Project Capsule Authors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
package resources
|
|
|
|
import (
|
|
"time"
|
|
|
|
"k8s.io/apimachinery/pkg/util/wait"
|
|
)
|
|
|
|
func jitteredResync(period time.Duration) time.Duration {
|
|
if period <= 0 {
|
|
return 0
|
|
}
|
|
|
|
return wait.Jitter(period, 0.1)
|
|
}
|