Update NetSender config if reconfig is needed.

This commit is contained in:
Alan Noble 2018-05-06 21:39:44 +09:30
parent 463e983b21
commit 3ce4fae82b
1 changed files with 4 additions and 3 deletions

View File

@ -299,11 +299,12 @@ func periodicNetsenderReport() {
} }
} }
//inputs := []string{"X20", "X21"}
inputs := netsender.SplitCSV(netsender.GetConfigParam("inputs")) inputs := netsender.SplitCSV(netsender.GetConfigParam("inputs"))
if _, _, err := netsender.Send(netsender.RequestPoll, inputs); err != nil { if _, reconfig, err := netsender.Send(netsender.RequestPoll, inputs); err == nil && reconfig {
if err = netsender.GetConfig(); err != nil {
config.Logger.Log("Error", err.Error()) config.Logger.Log("Error", err.Error())
} }
}
if cloudVarSum := netsender.GetVarSum(); cloudVarSum != varSum { if cloudVarSum := netsender.GetVarSum(); cloudVarSum != varSum {
if newVars, err := netsender.GetVars(); err != nil { if newVars, err := netsender.GetVars(); err != nil {