This is an automated email from the ASF dual-hosted git repository.
tianxiaoliang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/servicecomb-service-center.git
The following commit(s) were added to refs/heads/master by this push:
new a840986 Upgrade etcdadpt pkg (#1160)
a840986 is described below
commit a84098654af8007198273b4f0cc703a5d7802818
Author: little-cui <[email protected]>
AuthorDate: Tue Oct 12 08:58:42 2021 +0800
Upgrade etcdadpt pkg (#1160)
---
datasource/etcd/event/dependency_event_handler.go | 5 +----
etc/conf/app.yaml | 2 +-
go.mod | 2 +-
go.sum | 6 ++++++
pkg/rest/router.go | 2 +-
server/config/config.go | 8 ++++++--
server/server.go | 1 +
7 files changed, 17 insertions(+), 9 deletions(-)
diff --git a/datasource/etcd/event/dependency_event_handler.go
b/datasource/etcd/event/dependency_event_handler.go
index 8a427d4..db0730e 100644
--- a/datasource/etcd/event/dependency_event_handler.go
+++ b/datasource/etcd/event/dependency_event_handler.go
@@ -149,10 +149,7 @@ func (h *DependencyEventHandler) Handle() error {
key := path.GetServiceDependencyQueueRootKey("")
resp, err := sd.DependencyQueue().Search(context.Background(),
etcdadpt.WithNoCache(),
- etcdadpt.WithStrKey(key), etcdadpt.WithPrefix(),
- etcdadpt.WithOrderByCreate(), etcdadpt.WithAscendOrder(),
- // get one page
- etcdadpt.WithLimit(etcdadpt.DefaultPageCount))
+ etcdadpt.WithStrKey(key), etcdadpt.WithPrefix())
if err != nil {
return err
}
diff --git a/etc/conf/app.yaml b/etc/conf/app.yaml
index 03ba0ac..d4cdc3a 100644
--- a/etc/conf/app.yaml
+++ b/etc/conf/app.yaml
@@ -105,7 +105,7 @@ registry:
# endpoints: sc-0=http://127.0.0.1:2380
# if registry_plugin equals to 'etcd', then
# endpoints: 127.0.0.1:2379
- endpoints: 127.0.0.1:2379
+ endpoints: http://127.0.0.1:2379
# the timeout for failing to establish a connection
connect:
timeout: 10s
diff --git a/go.mod b/go.mod
index decece8..cc958db 100644
--- a/go.mod
+++ b/go.mod
@@ -24,7 +24,7 @@ require (
github.com/jinzhu/copier v0.3.0
github.com/karlseguin/ccache
v2.0.3-0.20170217060820-3ba9789cfd2c+incompatible
github.com/labstack/echo/v4 v4.1.18-0.20201218141459-936c48a17e97
- github.com/little-cui/etcdadpt v0.1.4-0.20210902120751-b6d0212f913e
+ github.com/little-cui/etcdadpt v0.2.1
github.com/olekukonko/tablewriter v0.0.5
github.com/onsi/ginkgo v1.15.0
github.com/onsi/gomega v1.10.5
diff --git a/go.sum b/go.sum
index d66c20c..430ec10 100644
--- a/go.sum
+++ b/go.sum
@@ -612,6 +612,12 @@ github.com/lightstep/lightstep-tracer-go v0.18.1
h1:vi1F1IQ8N7hNWytK9DpJsUfQhGuN
github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod
h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4=
github.com/little-cui/etcdadpt v0.1.4-0.20210902120751-b6d0212f913e
h1:pcA89qPpIdaBur0ha7RCfKDv5jK2LnilHrTS2FPkzYY=
github.com/little-cui/etcdadpt v0.1.4-0.20210902120751-b6d0212f913e/go.mod
h1:727wftF2FS4vfkgFLmIvQue1XH+9u4lK2/hd6L7OAC8=
+github.com/little-cui/etcdadpt v0.2.0
h1:6UE6CHzKHVMSb4jkBjWynVBV+2QC+XfMkYW80j10wtM=
+github.com/little-cui/etcdadpt v0.2.0/go.mod
h1:727wftF2FS4vfkgFLmIvQue1XH+9u4lK2/hd6L7OAC8=
+github.com/little-cui/etcdadpt v0.2.1-0.20211011160708-27df691edc3e
h1:wdFXNX2cusZPoIKsRw003s+TbFQ6A0h89IEQNcZ4ml0=
+github.com/little-cui/etcdadpt v0.2.1-0.20211011160708-27df691edc3e/go.mod
h1:727wftF2FS4vfkgFLmIvQue1XH+9u4lK2/hd6L7OAC8=
+github.com/little-cui/etcdadpt v0.2.1
h1:eT1A+BV1/2/dmmZA2Nl+cc7uTMuwd6T6DD+JrXr8xcA=
+github.com/little-cui/etcdadpt v0.2.1/go.mod
h1:727wftF2FS4vfkgFLmIvQue1XH+9u4lK2/hd6L7OAC8=
github.com/lyft/protoc-gen-validate v0.0.13
h1:KNt/RhmQTOLr7Aj8PsJ7mTronaFyx80mRTT9qF261dA=
github.com/lyft/protoc-gen-validate v0.0.13/go.mod
h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ=
github.com/magiconair/properties v1.8.1
h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4=
diff --git a/pkg/rest/router.go b/pkg/rest/router.go
index 9521340..492ecbe 100644
--- a/pkg/rest/router.go
+++ b/pkg/rest/router.go
@@ -121,7 +121,7 @@ func (router *Router) serve(ph *urlPatternHandler, w
http.ResponseWriter, r *htt
Invoke(doNothingFunc)
}
-// NewRouter news an Router
+// NewRouter news a Router
func NewRouter() *Router {
return &Router{
handlers: make(map[string][]*urlPatternHandler),
diff --git a/server/config/config.go b/server/config/config.go
index 779351e..c1ee4f8 100644
--- a/server/config/config.go
+++ b/server/config/config.go
@@ -86,12 +86,16 @@ func GetRBAC() ServerConfigDetail {
func Init() {
setCPUs()
- err := archaius.Init(archaius.WithMemorySource(),
archaius.WithENVSource(),
-
archaius.WithOptionalFiles([]string{filepath.Join(util.GetAppRoot(), "conf",
"app.yaml")}))
+ err := archaius.Init(archaius.WithMemorySource(),
archaius.WithENVSource())
if err != nil {
log.Fatal("can not init archaius", err)
}
+ err = archaius.AddFile(filepath.Join(util.GetAppRoot(), "conf",
"app.yaml"))
+ if err != nil {
+ log.Warn(fmt.Sprintf("can not add config file source, error:
%s", err))
+ }
+
err = Reload()
if err != nil {
log.Fatal("reload configs failed", err)
diff --git a/server/server.go b/server/server.go
index d9955dc..4732cd2 100644
--- a/server/server.go
+++ b/server/server.go
@@ -119,6 +119,7 @@ func (s *ServiceCenterServer) initDatasource() {
if err := datasource.Init(datasource.Options{
Config: etcdadpt.Config{
Kind: kind,
+ Logger: log.Logger,
SslEnabled: config.GetSSL().SslEnabled,
TLSConfig: tlsConfig,
ConnectedFunc: func() {