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,10 +299,11 @@ 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 {
config.Logger.Log("Error", err.Error()) if err = netsender.GetConfig(); err != nil {
config.Logger.Log("Error", err.Error())
}
} }
if cloudVarSum := netsender.GetVarSum(); cloudVarSum != varSum { if cloudVarSum := netsender.GetVarSum(); cloudVarSum != varSum {