From 4e1ceb140dd68c0be62ec49a8e06559011273511 Mon Sep 17 00:00:00 2001 From: Saxon Date: Sat, 2 Mar 2019 12:49:09 +1030 Subject: [PATCH] revid: if start is called when revid is already running an error is no longer returned --- revid/revid.go | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/revid/revid.go b/revid/revid.go index edbfc3d0..ee6bc992 100644 --- a/revid/revid.go +++ b/revid/revid.go @@ -202,10 +202,7 @@ func (r *Revid) handleErrors() { err := <-r.err if err != nil { r.config.Logger.Log(logger.Error, pkg+"async error", "error", err.Error()) - err = r.Stop() - if err != nil { - r.config.Logger.Log(logger.Error, pkg+"failed to stop in response to error", "error", err.Error()) - } + r.Stop() err = r.Start() if err != nil { r.config.Logger.Log(logger.Error, pkg+"failed to restart in response to error", "error", err.Error()) @@ -342,7 +339,8 @@ func (r *Revid) setIsRunning(b bool) { // and packetising (if theres packetization) to a defined output. func (r *Revid) Start() error { if r.IsRunning() { - return errors.New(pkg + "start called but revid is already running") + r.config.Logger.Log(logger.Warning, pkg+"start called, but revid already running") + return nil } r.config.Logger.Log(logger.Info, pkg+"starting Revid") // TODO: this doesn't need to be here @@ -376,9 +374,7 @@ func (r *Revid) Stop() { func (r *Revid) Update(vars map[string]string) error { if r.IsRunning() { - if err := r.Stop(); err != nil { - return err - } + r.Stop() } //look through the vars and update revid where needed for key, value := range vars {