replace time.Now().Sub with time.Since

Kubernetes-commit: 5c9f4d9dc67b28fb31fd95f88448c09150a4cbfb
This commit is contained in:
shinytang6
2019-03-18 23:57:26 +08:00
committed by Kubernetes Publisher
parent 6a49eed407
commit 861da69465
3 changed files with 4 additions and 4 deletions

View File

@@ -363,7 +363,7 @@ loop:
}
}
watchDuration := r.clock.Now().Sub(start)
watchDuration := r.clock.Since(start)
if watchDuration < 1*time.Second && eventCount == 0 {
return fmt.Errorf("very short watch: %s: Unexpected watch close - watch lasted less than a second and no items received", r.name)
}