mirror of https://bitbucket.org/ausocean/av.git
cmd/rv/main.go fix probe initialization
This commit is contained in:
parent
6dd32ea786
commit
c58643e207
|
@ -146,6 +146,11 @@ func main() {
|
|||
p *turbidityProbe
|
||||
)
|
||||
|
||||
p, err := NewTurbidityProbe(*log, 60*time.Second)
|
||||
if err != nil {
|
||||
log.Log(logger.Fatal, "could not create new turbidity probe", "error", err.Error())
|
||||
}
|
||||
|
||||
log.Log(logger.Debug, "initialising netsender client")
|
||||
ns, err := netsender.New(log, nil, readPin(p, rv, log), nil, createVarMap())
|
||||
if err != nil {
|
||||
|
@ -158,11 +163,6 @@ func main() {
|
|||
log.Log(logger.Fatal, pkg+"could not initialise revid", "error", err.Error())
|
||||
}
|
||||
|
||||
p, err = NewTurbidityProbe(*log, 60*time.Second)
|
||||
if err != nil {
|
||||
log.Log(logger.Fatal, "could not create new turbidity probe", "error", err.Error())
|
||||
}
|
||||
|
||||
err = rv.SetProbe(p)
|
||||
if err != nil {
|
||||
log.Log(logger.Error, pkg+"could not set probe", "error", err.Error())
|
||||
|
|
|
@ -165,7 +165,7 @@ func (tp *turbidityProbe) Update(config config.Config) error {
|
|||
return nil
|
||||
}
|
||||
}
|
||||
tp.log.Log(logger.Debug, "not update requried")
|
||||
tp.log.Log(logger.Debug, "no update requried")
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue