You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by ni...@apache.org on 2019/11/26 08:18:43 UTC

[servicecomb-mesher] branch master updated: use latest foundation

This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/servicecomb-mesher.git


The following commit(s) were added to refs/heads/master by this push:
     new 3260842  use latest foundation
     new 91d11d2  Merge pull request #86 from tianxiaoliang/master
3260842 is described below

commit 326084219821e3d1646b4af625859ae2e173b5cc
Author: tian <xi...@gmail.com>
AuthorDate: Mon Nov 25 18:18:57 2019 +0800

    use latest foundation
---
 go.mod                  |  9 +++++----
 proxy/health/l7check.go | 12 +++---------
 2 files changed, 8 insertions(+), 13 deletions(-)

diff --git a/go.mod b/go.mod
index 89a7514..d21e1cb 100644
--- a/go.mod
+++ b/go.mod
@@ -1,13 +1,12 @@
 module github.com/apache/servicecomb-mesher
 
 require (
-	github.com/apache/servicecomb-kie v0.0.0-20191021014716-b4dc01d3968b
+	github.com/apache/servicecomb-kie v0.1.1-0.20191119112752-d564a5ac0115
 	github.com/envoyproxy/go-control-plane v0.6.0
 	github.com/ghodss/yaml v1.0.0
-	github.com/go-chassis/foundation v0.0.0-20190621030543-c3b63f787f4c
+	github.com/go-chassis/foundation v0.1.1-0.20191113114104-2b05871e9ec4
 	github.com/go-chassis/go-archaius v0.24.0
-	github.com/go-chassis/go-chassis v1.7.3-0.20191018125535-1a99ab41f7ea
-	github.com/go-chassis/go-chassis-config v0.14.0
+	github.com/go-chassis/go-chassis v1.7.6
 	github.com/go-chassis/gohessian v0.0.0-20180702061429-e5130c25af55
 	github.com/go-mesh/openlogging v1.0.1
 	github.com/gogo/googleapis v1.3.0 // indirect
@@ -36,3 +35,5 @@ replace (
 	github.com/openzipkin-contrib/zipkin-go-opentracing v0.3.5 => github.com/go-chassis/zipkin-go-opentracing v0.3.5-0.20190321072447-42cf74fc2a92
 	github.com/tetratelabs/go2sky v0.1.1-0.20190703154722-1eaab8035277 => github.com/SkyAPM/go2sky v0.1.1-0.20190703154722-1eaab8035277
 )
+
+go 1.13
diff --git a/proxy/health/l7check.go b/proxy/health/l7check.go
index 37a4d1e..871ab00 100644
--- a/proxy/health/l7check.go
+++ b/proxy/health/l7check.go
@@ -18,19 +18,19 @@
 package health
 
 import (
+	"context"
 	"errors"
 	"github.com/apache/servicecomb-mesher/proxy/config"
 	"github.com/go-chassis/foundation/httpclient"
 	"github.com/go-mesh/openlogging"
 	"io/ioutil"
-	"net/http"
 	"regexp"
 	"strconv"
 )
 
 //HTTPCheck checks http service
 func HTTPCheck(check *config.HealthCheck, address string) error {
-	c, err := httpclient.GetURLClient(&httpclient.DefaultURLClientOption)
+	c, err := httpclient.New(&httpclient.DefaultOptions)
 	if err != nil {
 		openlogging.Error("can not get http client: " + err.Error())
 		//must not return error, because it is mesher error
@@ -40,13 +40,7 @@ func HTTPCheck(check *config.HealthCheck, address string) error {
 	if check.URI != "" {
 		url = url + check.URI
 	}
-	req, err := http.NewRequest("GET", url, nil)
-	if err != nil {
-		openlogging.Error("can not get http req: " + err.Error())
-		//must not return error, because it is mesher error
-		return nil
-	}
-	resp, err := c.Do(req)
+	resp, err := c.Get(context.Background(), url, nil)
 	if err != nil {
 		openlogging.Error("server can not be connected: " + err.Error())
 		return err