mirror of https://bitbucket.org/ausocean/av.git
cmd/rv/main.go: moved initialisation of revid to above run call
This commit is contained in:
parent
10a8c70e6d
commit
86f804cf53
|
@ -118,6 +118,11 @@ func main() {
|
|||
log.Log(logger.Fatal, pkg+"could not initialise netsender client: "+err.Error())
|
||||
}
|
||||
|
||||
rv, err = revid.New(config.Config{Logger: log}, ns)
|
||||
if err != nil {
|
||||
log.Log(logger.Fatal, pkg+"could not initialise revid", "error", err.Error())
|
||||
}
|
||||
|
||||
run(rv, ns, log, netLog)
|
||||
}
|
||||
|
||||
|
@ -153,16 +158,6 @@ func run(rv *revid.Revid, ns *netsender.Sender, l *logger.Logger, nl *netlogger.
|
|||
continue
|
||||
}
|
||||
|
||||
// If first time running loop, i.e. rv == nil, then we create a new Revid.
|
||||
if rv == nil {
|
||||
rv, err = revid.New(config.Config{Logger: l}, ns)
|
||||
if err != nil {
|
||||
l.Log(logger.Warning, pkg+"could not initialise revid", "error", err.Error())
|
||||
sleep(ns, l)
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
// Configure revid based on the vars.
|
||||
err = rv.Update(vars)
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in New Issue