This is an automated email from the ASF dual-hosted git repository. littlecui pushed a commit to branch front in repository https://gitbox.apache.org/repos/asf/servicecomb-service-center.git
commit 3fb568327fc7efe57f79eaa5ec13789db6ccbd53 Author: little-cui <[email protected]> AuthorDate: Mon Oct 11 22:19:06 2021 +0800 Upgrade etcdadpt pkg --- datasource/etcd/event/dependency_event_handler.go | 5 +---- go.mod | 2 +- go.sum | 2 ++ pkg/rest/router.go | 2 +- server/config/config.go | 8 ++++++-- 5 files changed, 11 insertions(+), 8 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/go.mod b/go.mod index decece8..ca71304 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.0 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..0a36c81 100644 --- a/go.sum +++ b/go.sum @@ -612,6 +612,8 @@ 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/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..7fb5832 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.Fatal("can not add config file source", err) + } + err = Reload() if err != nil { log.Fatal("reload configs failed", err)
