[skip-ci]Fix golint in param_table in datanode (#8602)

Signed-off-by: yangxuan <xuan.yang@zilliz.com>
pull/8579/head
XuanYang-cn 2021-09-26 20:57:59 +08:00 committed by GitHub
parent ebd894d8b7
commit 1307782093
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -22,6 +22,7 @@ import (
"github.com/milvus-io/milvus/internal/util/paramtable"
)
// ParamTable in DataNode contains all configs for DataNode
type ParamTable struct {
paramtable.BaseTable
@ -71,19 +72,23 @@ type ParamTable struct {
UpdatedTime time.Time
}
// Params is global var in DataNode
var Params ParamTable
var once sync.Once
// InitAlias init this DataNode alias
func (p *ParamTable) InitAlias(alias string) {
p.Alias = alias
}
// InitOnce call params Init only once
func (p *ParamTable) InitOnce() {
once.Do(func() {
p.Init()
})
}
// Init initializes DataNode configs
func (p *ParamTable) Init() {
p.BaseTable.Init()
err := p.LoadYaml("advanced/data_node.yaml")