mirror of
https://github.com/kubernetes/client-go.git
synced 2025-09-05 17:10:27 +00:00
Change time.Now().Sub(x) to time.Since(x) for cleanup
Kubernetes-commit: 878548ceac9c109881c379911b8b0d8fce5ea68e
This commit is contained in:
committed by
Kubernetes Publisher
parent
47b3cad4de
commit
ca138c86e8
2
tools/cache/mutation_detector.go
vendored
2
tools/cache/mutation_detector.go
vendored
@@ -99,7 +99,7 @@ func (d *defaultCacheMutationDetector) Run(stopCh <-chan struct{}) {
|
||||
for {
|
||||
if d.lastRotated.IsZero() {
|
||||
d.lastRotated = time.Now()
|
||||
} else if time.Now().Sub(d.lastRotated) > d.retainDuration {
|
||||
} else if time.Since(d.lastRotated) > d.retainDuration {
|
||||
d.retainedCachedObjs = d.cachedObjs
|
||||
d.cachedObjs = nil
|
||||
d.lastRotated = time.Now()
|
||||
|
Reference in New Issue
Block a user