From 0e4f6c6d648d650ec7d0e13169ad30001b1bbb92 Mon Sep 17 00:00:00 2001 From: gaoshiyao Date: Tue, 22 Oct 2019 11:53:36 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A1=E6=95=B0=E8=BF=87=E6=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/handler/proxyhandler.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/handler/proxyhandler.go b/src/handler/proxyhandler.go index 7004e6e..eaa1cda 100644 --- a/src/handler/proxyhandler.go +++ b/src/handler/proxyhandler.go @@ -21,9 +21,12 @@ func CreateProxyHandler() (*ProxyHandler, error) { handler := new(ProxyHandler) fwd, _ := forward.New(forward.PassHostHeader(true)) handler.forward = fwd + ch = make(chan bool, 1) return handler, nil } +var ch chan bool + func (handler *ProxyHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) { if err := count(); err != nil { fmt.Println(err.Error()) @@ -75,6 +78,6 @@ func count() error { return err } ic, err := redis.Incr(fmt.Sprintf("%s%s", config.ProxyHost, config.ProxyPath)) - fmt.Println(ic) + _, err = ic.Result() return err } -- 2.26.0