mirror of https://bitbucket.org/ausocean/av.git
revid-cli: dealing with errors in revid-cli from start and stop if they occur
This commit is contained in:
parent
5ae1e41e38
commit
19ae6f1ca6
|
@ -343,21 +343,28 @@ func startRevid(ns *netsender.Sender, cfg revid.Config) (*revid.Revid, revid.Con
|
|||
if err != nil {
|
||||
return nil, cfg, err
|
||||
}
|
||||
rv.Start()
|
||||
return rv, cfg, nil
|
||||
err = rv.Start()
|
||||
return rv, cfg, err
|
||||
}
|
||||
|
||||
func stopRevid(rv *revid.Revid) {
|
||||
rv.Stop()
|
||||
func stopRevid(rv *revid.Revid) error {
|
||||
err := rv.Stop()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// FIXME(kortschak): Is this waiting on completion of work?
|
||||
// Use a wait group and Wait method if it is.
|
||||
time.Sleep(revidStopTime)
|
||||
return nil
|
||||
}
|
||||
|
||||
func updateRevid(ns *netsender.Sender, rv *revid.Revid, cfg revid.Config, vars map[string]string, stop bool) (*revid.Revid, revid.Config, error) {
|
||||
if stop {
|
||||
stopRevid(rv)
|
||||
err := stopRevid(rv)
|
||||
if err != nil {
|
||||
return nil, cfg, err
|
||||
}
|
||||
}
|
||||
|
||||
//look through the vars and update revid where needed
|
||||
|
|
Loading…
Reference in New Issue