Browse Source

Merge pull request #4995 from gyuho/proxy-clean

proxy: simplify channel receive, add missing function call
Gyu-Ho Lee 9 years ago
parent
commit
5d4ee7ac5f
2 changed files with 3 additions and 4 deletions
  1. 2 4
      proxy/director.go
  2. 1 0
      proxy/reverse.go

+ 2 - 4
proxy/director.go

@@ -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

+ 1 - 0
proxy/reverse.go

@@ -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()