Skip to content

Commit

Permalink
rename Router to Routers
Browse files Browse the repository at this point in the history
  • Loading branch information
dongjianhui03 committed Oct 25, 2021
1 parent 52090c3 commit dd0867d
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.yaml"
configFilePath := "../conf/dubbogo.yml"
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"`

Router []*RouterConfig `yaml:"router" json:"router,omitempty" property:"router"`
Routers []*RouterConfig `yaml:"routers" 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.Router = router
rb.rootConfig.Routers = 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.Router
routers := rc.Routers
if len(routers) > 0 {
for _, r := range routers {
if err := r.Init(); err != nil {
return err
}
}
rc.Router = routers
rc.Routers = 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 TestMetadataReport_MetadataReportRetry(t *testing.T) {
func TestMetadataReportRetry(t *testing.T) {
counter := atomic.NewInt64(1)

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

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

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

Expand Down

0 comments on commit dd0867d

Please sign in to comment.