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
|
@ -202,10 +202,7 @@ func (r *Revid) handleErrors() {
|
||||||
err := <-r.err
|
err := <-r.err
|
||||||
if err != nil {
|
if err != nil {
|
||||||
r.config.Logger.Log(logger.Error, pkg+"async error", "error", err.Error())
|
r.config.Logger.Log(logger.Error, pkg+"async error", "error", err.Error())
|
||||||
err = r.Stop()
|
r.Stop()
|
||||||
if err != nil {
|
|
||||||
r.config.Logger.Log(logger.Error, pkg+"failed to stop in response to error", "error", err.Error())
|
|
||||||
}
|
|
||||||
err = r.Start()
|
err = r.Start()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
r.config.Logger.Log(logger.Error, pkg+"failed to restart in response to error", "error", err.Error())
|
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.
|
// and packetising (if theres packetization) to a defined output.
|
||||||
func (r *Revid) Start() error {
|
func (r *Revid) Start() error {
|
||||||
if r.IsRunning() {
|
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")
|
r.config.Logger.Log(logger.Info, pkg+"starting Revid")
|
||||||
// TODO: this doesn't need to be here
|
// 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 {
|
func (r *Revid) Update(vars map[string]string) error {
|
||||||
if r.IsRunning() {
|
if r.IsRunning() {
|
||||||
if err := r.Stop(); err != nil {
|
r.Stop()
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
//look through the vars and update revid where needed
|
//look through the vars and update revid where needed
|
||||||
for key, value := range vars {
|
for key, value := range vars {
|
||||||
|
|
Loading…
Reference in New Issue