Browse Source

feat(config): Set UpdateBranchSync default value as 1 in config struct

pull/550/head
徐云金YunjinXu 1 year ago
parent
commit
57d3fbf103
  1. 2
      dtmsvr/config/config.go
  2. 3
      dtmsvr/config/config_test.go

2
dtmsvr/config/config.go

@ -95,7 +95,7 @@ type Type struct {
JSONRPCPort int64 `yaml:"JsonRpcPort" default:"36791"`
MicroService MicroService `yaml:"MicroService"`
HTTPMicroService HTTPMicroService `yaml:"HttpMicroService"`
UpdateBranchSync int64 `yaml:"UpdateBranchSync"`
UpdateBranchSync int64 `yaml:"UpdateBranchSync" default:"1"`
UpdateBranchAsyncGoroutineNum int64 `yaml:"UpdateBranchAsyncGoroutineNum" default:"1"`
LogLevel string `yaml:"LogLevel" default:"info"`
Log Log `yaml:"Log"`

3
dtmsvr/config/config_test.go

@ -19,6 +19,9 @@ func TestLoadFromEnv(t *testing.T) {
func TestLoadConfig(t *testing.T) {
MustLoadConfig("../../conf.sample.yml")
//assert default value
assert.Equal(t, int64(1), Config.UpdateBranchSync)
}
func TestCheckConfig(t *testing.T) {
conf := Config

Loading…
Cancel
Save