initialize bug fixed
This commit is contained in:
parent
844969c5c1
commit
31e314ec87
|
@ -86,7 +86,7 @@ func (handler APIHandler) ElasticsearchOverviewAction(w http.ResponseWriter, req
|
|||
if err != nil{
|
||||
log.Error(err)
|
||||
}
|
||||
if v, ok := hostCount.(float64); ok && v == 0 {
|
||||
if v, ok := hostCount.(float64); (ok && v == 0) || hostCount == nil {
|
||||
hostCount, err = handler.getMetricCount(orm.GetIndexName(elastic.NodeConfig{}), "metadata.host", clusterIDs)
|
||||
if err != nil{
|
||||
log.Error(err)
|
||||
|
|
|
@ -399,7 +399,16 @@ func (module *Module) initialize(w http.ResponseWriter, r *http.Request, ps http
|
|||
|
||||
if dslWriteSuccess{
|
||||
lines := util.FileGetLines(dslFile)
|
||||
_,err,_:=replay.ReplayLines(pipeline.AcquireContext(),lines,cfg.Schema,cfg.Host)
|
||||
ctx := pipeline.AcquireContext()
|
||||
var (
|
||||
username string
|
||||
password string
|
||||
)
|
||||
if cfg.BasicAuth != nil {
|
||||
username = cfg.BasicAuth.Username
|
||||
password = cfg.BasicAuth.Password
|
||||
}
|
||||
_,err,_:=replay.ReplayLines(ctx,lines,cfg.Schema,cfg.Host,username,password)
|
||||
if err!=nil{
|
||||
log.Error(err)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue