Skip to content

Commit 57d3fbf

Browse files
committed
feat(config): Set UpdateBranchSync default value as 1 in config struct
1 parent 3a178ca commit 57d3fbf

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

dtmsvr/config/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ type Type struct {
9595
JSONRPCPort int64 `yaml:"JsonRpcPort" default:"36791"`
9696
MicroService MicroService `yaml:"MicroService"`
9797
HTTPMicroService HTTPMicroService `yaml:"HttpMicroService"`
98-
UpdateBranchSync int64 `yaml:"UpdateBranchSync"`
98+
UpdateBranchSync int64 `yaml:"UpdateBranchSync" default:"1"`
9999
UpdateBranchAsyncGoroutineNum int64 `yaml:"UpdateBranchAsyncGoroutineNum" default:"1"`
100100
LogLevel string `yaml:"LogLevel" default:"info"`
101101
Log Log `yaml:"Log"`

dtmsvr/config/config_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ func TestLoadFromEnv(t *testing.T) {
1919

2020
func TestLoadConfig(t *testing.T) {
2121
MustLoadConfig("../../conf.sample.yml")
22+
23+
//assert default value
24+
assert.Equal(t, int64(1), Config.UpdateBranchSync)
2225
}
2326
func TestCheckConfig(t *testing.T) {
2427
conf := Config

0 commit comments

Comments
 (0)