mirror of https://bitbucket.org/ausocean/av.git
revid: if start is called when revid is already running an error is no longer returned
This commit is contained in:
parent
c9996cbae5
commit
4e1ceb140d
revid
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue