From 51d195b84d33c16c18f131391317150f1a1c5cd7 Mon Sep 17 00:00:00 2001
From: ale <ale@incal.net>
Date: Sun, 17 Nov 2013 18:10:20 +0000
Subject: [PATCH] do not forget to start the icecast status checker

---
 node/icecast.go | 4 +++-
 node/node.go    | 3 +++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/node/icecast.go b/node/icecast.go
index e34eb559..86a757af 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 3a29336e..390c8cf5 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 {
-- 
GitLab