Skip to content

Commit

Permalink
[fix] cancel the depency between healthcheck and etcd
Browse files Browse the repository at this point in the history
  • Loading branch information
songshiyuan 00649746 committed Feb 19, 2024
1 parent 0167fb0 commit 8ca83ab
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions pkg/common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ const (
QueryParamURLPath = "urlPath"
QueryParamUserAgent = "userAgent"
QueryParamOverride = "override"
QueryParamHealthCheck = "healthCheck"
)

// http headers
Expand Down
10 changes: 8 additions & 2 deletions server/resource/v1/admin_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,15 @@ import (
"strconv"
"time"

"github.com/apache/servicecomb-kie/pkg/model"
"github.com/apache/servicecomb-kie/server/datasource"
goRestful "github.com/emicklei/go-restful"
"github.com/go-chassis/cari/config"
"github.com/go-chassis/go-chassis/v2/pkg/runtime"
"github.com/go-chassis/go-chassis/v2/server/restful"
"github.com/go-chassis/openlog"

"github.com/apache/servicecomb-kie/pkg/common"
"github.com/apache/servicecomb-kie/pkg/model"
"github.com/apache/servicecomb-kie/server/datasource"
)

type AdminResource struct {
Expand Down Expand Up @@ -57,6 +59,10 @@ func (r *AdminResource) URLPatterns() []restful.Route {

// HealthCheck provider version info and time info
func (r *AdminResource) HealthCheck(context *restful.Context) {
healthCheck := context.ReadQueryParameter(common.QueryParamHealthCheck)
if healthCheck == "true" {
return
}
domain := ReadDomain(context.Ctx)
resp := &model.DocHealthCheck{}
latest, err := datasource.GetBroker().GetRevisionDao().GetRevision(context.Ctx, domain)
Expand Down

0 comments on commit 8ca83ab

Please sign in to comment.