rename tempID to GlobalSystemElasticsearchID
This commit is contained in:
parent
67382361a1
commit
0cd198b805
|
@ -112,7 +112,7 @@ type SetupRequest struct {
|
||||||
CredentialSecret string `json:"credential_secret"`
|
CredentialSecret string `json:"credential_secret"`
|
||||||
}
|
}
|
||||||
|
|
||||||
var tempID="infini_default_system_cluster"
|
var GlobalSystemElasticsearchID="infini_default_system_cluster"
|
||||||
|
|
||||||
const VersionTooOld ="elasticsearch_version_too_old"
|
const VersionTooOld ="elasticsearch_version_too_old"
|
||||||
const IndicesExists ="elasticsearch_indices_exists"
|
const IndicesExists ="elasticsearch_indices_exists"
|
||||||
|
@ -276,7 +276,7 @@ func (module *Module) initTempClient(r *http.Request) (error, elastic.API,SetupR
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
cfg.ID = tempID
|
cfg.ID = GlobalSystemElasticsearchID
|
||||||
cfg.Name = "INFINI_SYSTEM ("+util.PickRandomName()+")"
|
cfg.Name = "INFINI_SYSTEM ("+util.PickRandomName()+")"
|
||||||
elastic.InitMetadata(&cfg, true)
|
elastic.InitMetadata(&cfg, true)
|
||||||
client, err := elastic1.InitClientWithConfig(cfg)
|
client, err := elastic1.InitClientWithConfig(cfg)
|
||||||
|
@ -284,7 +284,7 @@ func (module *Module) initTempClient(r *http.Request) (error, elastic.API,SetupR
|
||||||
return err,nil,request
|
return err,nil,request
|
||||||
}
|
}
|
||||||
|
|
||||||
global.Register(elastic.GlobalSystemElasticsearchID,tempID)
|
global.Register(elastic.GlobalSystemElasticsearchID,GlobalSystemElasticsearchID)
|
||||||
|
|
||||||
elastic.UpdateConfig(cfg)
|
elastic.UpdateConfig(cfg)
|
||||||
elastic.UpdateClient(cfg, client)
|
elastic.UpdateClient(cfg, client)
|
||||||
|
@ -535,7 +535,7 @@ func (module *Module) initialize(w http.ResponseWriter, r *http.Request, ps http
|
||||||
_,err=util.FilePutContent(file,fmt.Sprintf("configs.template:\n - name: \"system\"\n path: ./config/system_config.tpl\n variable:\n " +
|
_,err=util.FilePutContent(file,fmt.Sprintf("configs.template:\n - name: \"system\"\n path: ./config/system_config.tpl\n variable:\n " +
|
||||||
"CLUSTER_ID: %v\n CLUSTER_ENDPINT: \"%v\"\n " +
|
"CLUSTER_ID: %v\n CLUSTER_ENDPINT: \"%v\"\n " +
|
||||||
"CLUSTER_USER: \"%v\"\n CLUSTER_VER: \"%v\"\n INDEX_PREFIX: \"%v\"",
|
"CLUSTER_USER: \"%v\"\n CLUSTER_VER: \"%v\"\n INDEX_PREFIX: \"%v\"",
|
||||||
tempID,cfg.Endpoint,cfg.BasicAuth.Username,cfg.Version,cfg1.IndexPrefix ))
|
GlobalSystemElasticsearchID,cfg.Endpoint,cfg.BasicAuth.Username,cfg.Version,cfg1.IndexPrefix ))
|
||||||
if err!=nil{
|
if err!=nil{
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue