proxy: simplify channel receive, add missing function call

This commit is contained in:
Gyu-Ho Lee 2016-04-07 12:20:03 -07:00
parent ee4ff1e448
commit 6abbdcdc06
2 changed files with 3 additions and 4 deletions

View File

@ -56,10 +56,8 @@ func newDirector(urlsFunc GetProxyURLs, failureWait time.Duration, refreshInterv
plog.Infof("endpoints found %q", sl)
})
}
select {
case <-time.After(ri):
d.refresh()
}
time.Sleep(ri)
d.refresh()
}
}()
return d

View File

@ -63,6 +63,7 @@ type reverseProxy struct {
}
func (p *reverseProxy) ServeHTTP(rw http.ResponseWriter, clientreq *http.Request) {
reportIncomingRequest(clientreq)
proxyreq := new(http.Request)
*proxyreq = *clientreq
startTime := time.Now()