Skip to content

Commit

Permalink
Revert "rename Router to Routers"
Browse files Browse the repository at this point in the history
This reverts commit dd0867d
  • Loading branch information
dongjianhui03 committed Oct 25, 2021
1 parent dd0867d commit 26de707
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion config/config_loader_options.go
Expand Up @@ -47,7 +47,7 @@ type loaderConf struct {
}

func NewLoaderConf(opts ...LoaderConfOption) *loaderConf {
configFilePath := "../conf/dubbogo.yml"
configFilePath := "../conf/dubbogo.yaml"
if configFilePathFromEnv := os.Getenv(constant.CONFIG_FILE_ENV_KEY); configFilePathFromEnv != "" {
configFilePath = configFilePathFromEnv
}
Expand Down
4 changes: 2 additions & 2 deletions config/root_config.go
Expand Up @@ -72,7 +72,7 @@ type RootConfig struct {
// Shutdown config
Shutdown *ShutdownConfig `yaml:"shutdown" json:"shutdown,omitempty" property:"shutdown"`

Routers []*RouterConfig `yaml:"routers" json:"router,omitempty" property:"router"`
Router []*RouterConfig `yaml:"router" json:"router,omitempty" property:"router"`

EventDispatcherType string `default:"direct" yaml:"event-dispatcher-type" json:"event-dispatcher-type,omitempty"`

Expand Down Expand Up @@ -279,7 +279,7 @@ func (rb *RootConfigBuilder) SetShutdown(shutdown *ShutdownConfig) *RootConfigBu
}

func (rb *RootConfigBuilder) SetRouter(router []*RouterConfig) *RootConfigBuilder {
rb.rootConfig.Routers = router
rb.rootConfig.Router = router
return rb
}

Expand Down
4 changes: 2 additions & 2 deletions config/router_config.go
Expand Up @@ -59,14 +59,14 @@ func (c *RouterConfig) Init() error {
}

func initRouterConfig(rc *RootConfig) error {
routers := rc.Routers
routers := rc.Router
if len(routers) > 0 {
for _, r := range routers {
if err := r.Init(); err != nil {
return err
}
}
rc.Routers = routers
rc.Router = routers
}

//chain.SetVSAndDRConfigByte(vsBytes, drBytes)
Expand Down
8 changes: 4 additions & 4 deletions metadata/report/delegate/delegate_report_test.go
Expand Up @@ -38,7 +38,7 @@ import (
"dubbo.apache.org/dubbo-go/v3/metadata/identifier"
)

func TestMetadataReportRetry(t *testing.T) {
func TestMetadataReport_MetadataReportRetry(t *testing.T) {
counter := atomic.NewInt64(1)

retry, err := newMetadataReportRetry(1, 10, func() bool {
Expand All @@ -49,11 +49,11 @@ func TestMetadataReportRetry(t *testing.T) {
retry.startRetryTask()
<-time.After(2500 * time.Millisecond)
retry.scheduler.Clear()
assert.Equal(t, int64(3), counter.Load())
assert.Equal(t, counter.Load(), int64(3))
logger.Info("over")
}

func TestMetadataReportRetryWithLimit(t *testing.T) {
func TestMetadataReport_MetadataReportRetryWithLimit(t *testing.T) {
counter := atomic.NewInt64(1)

retry, err := newMetadataReportRetry(1, 1, func() bool {
Expand All @@ -64,7 +64,7 @@ func TestMetadataReportRetryWithLimit(t *testing.T) {
retry.startRetryTask()
<-time.After(2500 * time.Millisecond)
retry.scheduler.Clear()
assert.Equal(t, int64(2), counter.Load())
assert.Equal(t, counter.Load(), int64(2))
logger.Info("over")
}

Expand Down

0 comments on commit 26de707

Please sign in to comment.