diff --git a/node/icecast.go b/node/icecast.go index e34eb5590cb59efe18e808ba3b6bad62446a447f..86a757af15d342bdcc5b7b0f8900a6aa28f23e3f 100644 --- a/node/icecast.go +++ b/node/icecast.go @@ -4,6 +4,7 @@ import ( "encoding/xml" "errors" "io" + "log" "net/http" "os" "os/exec" @@ -84,6 +85,7 @@ func (ic *IcecastController) statusUpdater() { if status, err := ic.fetchStatus(); err == nil { ic.status = status } else { + log.Printf("bad status from iceast: %v", err) ic.status = downStatus } case <-ic.stop: @@ -111,5 +113,5 @@ func (ic *IcecastController) parseStatusPage(input io.Reader) (*IcecastStatus, e } func (ic *IcecastController) Run() { - go ic.statusUpdater() + ic.statusUpdater() } diff --git a/node/node.go b/node/node.go index 3a29336eff206072fabb07b995a254ac5183d479..390c8cf5f24d248adb9879458b2e31c0f5951930 100644 --- a/node/node.go +++ b/node/node.go @@ -279,6 +279,9 @@ func (rc *RadioNode) Run() { // initialize. time.Sleep(200 * time.Millisecond) + // Start the Icecast status checker. + go rc.icecast.Run() + log.Printf("starting icecast updater") for { select {