[skip ci]Fix golint error in querynode (#10136)

Signed-off-by: zhenshan.cao <zhenshan.cao@zilliz.com>
pull/10139/head
zhenshan.cao 2021-10-18 21:36:39 +08:00 committed by GitHub
parent d6f95f49e8
commit dd24ea3737
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -24,6 +24,7 @@ import (
"github.com/milvus-io/milvus/internal/util/paramtable"
)
// ParamTable is used to record configuration items.
type ParamTable struct {
paramtable.BaseTable
@ -82,19 +83,23 @@ type ParamTable struct {
UpdatedTime time.Time
}
// Params is a package scoped variable of type ParamTable.
var Params ParamTable
var once sync.Once
// InitAlias initializes an alias for the QueryNode role.
func (p *ParamTable) InitAlias(alias string) {
p.Alias = alias
}
// InitOnce is used to initialize configuration items, and it will only be called once.
func (p *ParamTable) InitOnce() {
once.Do(func() {
p.Init()
})
}
// Init is used to initialize configuration items.
func (p *ParamTable) Init() {
p.BaseTable.Init()
if err := p.LoadYaml("advanced/query_node.yaml"); err != nil {