mirror of https://github.com/milvus-io/milvus.git
parent
01e210854d
commit
d3f8948c17
|
@ -12,6 +12,7 @@ import (
|
|||
"github.com/milvus-io/milvus/internal/log"
|
||||
"github.com/milvus-io/milvus/internal/util/hardware"
|
||||
"github.com/milvus-io/milvus/internal/util/metricsinfo"
|
||||
"github.com/milvus-io/milvus/internal/util/paramtable"
|
||||
"github.com/milvus-io/milvus/internal/util/typeutil"
|
||||
)
|
||||
|
||||
|
@ -92,6 +93,12 @@ func (c *run) execute(args []string, flags *flag.FlagSet) {
|
|||
os.Exit(-1)
|
||||
}
|
||||
|
||||
// setup config for embedded milvus
|
||||
if c.serverType == typeutil.EmbeddedRole {
|
||||
var params paramtable.BaseTable
|
||||
params.GlobalInitWithYaml("embedded-milvus.yaml")
|
||||
}
|
||||
|
||||
runtimeDir := createRuntimeDir(c.serverType)
|
||||
filename := getPidFileName(c.serverType, c.svrAlias)
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@ import (
|
|||
"runtime"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
config "github.com/milvus-io/milvus/internal/config"
|
||||
|
@ -57,7 +58,8 @@ var defaultYaml = DefaultMilvusYaml
|
|||
|
||||
// BaseTable the basics of paramtable
|
||||
type BaseTable struct {
|
||||
mgr *config.Manager
|
||||
once sync.Once
|
||||
mgr *config.Manager
|
||||
|
||||
configDir string
|
||||
YamlFile string
|
||||
|
@ -76,6 +78,16 @@ func NewBaseTableFromYamlOnly(yaml string) *BaseTable {
|
|||
return gp
|
||||
}
|
||||
|
||||
// GlobalInitWithYaml initializes the param table with the given yaml.
|
||||
// We will update the global DefaultYaml variable directly, once and for all.
|
||||
// GlobalInitWithYaml shall be called at the very beginning before initiating the base table.
|
||||
// GlobalInitWithYaml should be called only in standalone and embedded Milvus.
|
||||
func (gp *BaseTable) GlobalInitWithYaml(yaml string) {
|
||||
gp.once.Do(func() {
|
||||
defaultYaml = yaml
|
||||
})
|
||||
}
|
||||
|
||||
// init initializes the param table.
|
||||
// if refreshInterval greater than 0 will auto refresh config from source
|
||||
func (gp *BaseTable) init(refreshInterval int) {
|
||||
|
|
Loading…
Reference in New Issue