Skip to content
Snippets Groups Projects
Commit 51d195b8 authored by ale's avatar ale
Browse files

do not forget to start the icecast status checker

parent fc2d9387
No related branches found
No related tags found
No related merge requests found
...@@ -4,6 +4,7 @@ import ( ...@@ -4,6 +4,7 @@ import (
"encoding/xml" "encoding/xml"
"errors" "errors"
"io" "io"
"log"
"net/http" "net/http"
"os" "os"
"os/exec" "os/exec"
...@@ -84,6 +85,7 @@ func (ic *IcecastController) statusUpdater() { ...@@ -84,6 +85,7 @@ func (ic *IcecastController) statusUpdater() {
if status, err := ic.fetchStatus(); err == nil { if status, err := ic.fetchStatus(); err == nil {
ic.status = status ic.status = status
} else { } else {
log.Printf("bad status from iceast: %v", err)
ic.status = downStatus ic.status = downStatus
} }
case <-ic.stop: case <-ic.stop:
...@@ -111,5 +113,5 @@ func (ic *IcecastController) parseStatusPage(input io.Reader) (*IcecastStatus, e ...@@ -111,5 +113,5 @@ func (ic *IcecastController) parseStatusPage(input io.Reader) (*IcecastStatus, e
} }
func (ic *IcecastController) Run() { func (ic *IcecastController) Run() {
go ic.statusUpdater() ic.statusUpdater()
} }
...@@ -279,6 +279,9 @@ func (rc *RadioNode) Run() { ...@@ -279,6 +279,9 @@ func (rc *RadioNode) Run() {
// initialize. // initialize.
time.Sleep(200 * time.Millisecond) time.Sleep(200 * time.Millisecond)
// Start the Icecast status checker.
go rc.icecast.Run()
log.Printf("starting icecast updater") log.Printf("starting icecast updater")
for { for {
select { select {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment