Browse Source

add version timeout

reid 2 years ago
parent
commit
cb412168ac
1 changed files with 6 additions and 2 deletions
  1. 6 2
      main.go

+ 6 - 2
main.go

@@ -9,6 +9,7 @@ import (
 	"log/slog"
 	"net/http"
 	"os"
+	"time"
 
 	"github.com/gorilla/mux"
 )
@@ -70,8 +71,11 @@ func main() {
 		pierList = pierList + ", " + pier
 	}
 	logger.Info(pierList)
-	// block until returns (debug)
-	<-versionUpdateChannel
+	// block until returns or times out (debug)
+	select {
+	case <-versionUpdateChannel:
+	case <-time.After(time.Duration(5) * time.Second):
+	}
 
 	// Load Netdata
 	loadService(docker.LoadNetdata, "Unable to load Netdata!")