mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-23 22:27:38 -05:00
Use time.Since() for readability
This commit is contained in:
parent
a661007a55
commit
617012c3fb
1 changed files with 1 additions and 1 deletions
|
@ -100,7 +100,7 @@ func (p Proxy) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, error) {
|
||||||
start := time.Now()
|
start := time.Now()
|
||||||
keepRetrying := func() bool {
|
keepRetrying := func() bool {
|
||||||
// if we've tried long enough, break
|
// if we've tried long enough, break
|
||||||
if time.Now().Sub(start) >= upstream.GetTryDuration() {
|
if time.Since(start) >= upstream.GetTryDuration() {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
// otherwise, wait and try the next available host
|
// otherwise, wait and try the next available host
|
||||||
|
|
Loading…
Reference in a new issue