mirror of
https://github.com/caddyserver/caddy.git
synced 2024-11-26 02:09:47 +08:00
Use time.Since() for readability
This commit is contained in:
parent
a661007a55
commit
617012c3fb
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user