Commit 617012c3 authored by Matthew Holt's avatar Matthew Holt

Use time.Since() for readability

parent a661007a
...@@ -100,7 +100,7 @@ func (p Proxy) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, error) { ...@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment