Browse Source
Merge pull request #550 from wooln/feature/UpdateBranchSync-default-value
feat(config): Set UpdateBranchSync default value as 1 in config struct
pull/554/head
yedf2
1 year ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
4 additions and
1 deletions
-
dtmsvr/config/config.go
-
dtmsvr/config/config_test.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"` |
|
|
|
|
|
|
|
@ -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 |
|
|
|
|