diff --git a/caddyhttp/proxy/proxy.go b/caddyhttp/proxy/proxy.go index 2613e750c..fc2d727fa 100644 --- a/caddyhttp/proxy/proxy.go +++ b/caddyhttp/proxy/proxy.go @@ -100,7 +100,7 @@ func (p Proxy) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, error) { start := time.Now() keepRetrying := func() bool { // if we've tried long enough, break - if time.Now().Sub(start) >= upstream.GetTryDuration() { + if time.Since(start) >= upstream.GetTryDuration() { return false } // otherwise, wait and try the next available host