cmd/revid-cli & revid: added TODO for the use of Run() instead of send in cmd/revid-cli/main.go. Fixed filename in revid/revid.go file header. Renamed ret to cfg in revid.Config(). Catching error from call to revid.Stop() in revid.Udate()

This commit is contained in:
saxon 2019-02-04 19:14:02 +10:30
parent 1cdbfa2c66
commit bd2958ba4e
2 changed files with 7 additions and 4 deletions

View File

@ -286,6 +286,7 @@ func run(cfg revid.Config) error {
}
for {
// TODO(saxon): replace this call with call to ns.Run().
if err := send(&ns, rv); err != nil {
log.Log(logger.Error, pkg+"Run Failed. Retrying...", "error", err.Error())
time.Sleep(netSendRetryTime)

View File

@ -1,6 +1,6 @@
/*
NAME
r.go
revid.go
DESCRIPTION
See Readme.md
@ -329,9 +329,9 @@ func (r *Revid) IsRunning() bool {
func (r *Revid) Config() Config {
r.mu.Lock()
ret := r.config
cfg := r.config
r.mu.Unlock()
return ret
return cfg
}
// setIsRunning sets r.isRunning using b.
@ -379,7 +379,9 @@ func (r *Revid) Stop() error {
func (r *Revid) Update(vars map[string]string) error {
if r.IsRunning() {
r.Stop()
if err := r.Stop(); err != nil {
return err
}
}
//look through the vars and update revid where needed
for key, value := range vars {