🎧 Your Personal Streaming Service
Go airsonicmadsonicmedia-servermusicmusic-servernavidromeopensubsonicraspberry-piself-hostedstreamerstreaming-apistreaming-audiosubsonicsubsonic-server
Replace math.Max with utils.MaxInt
Deluan694be54428a7
diff --git a/server/server.go b/server/server.goindex 0c98a8555..990caad73 100644--- a/server/server.go+++ b/server/server.go@@ -1,7 +1,6 @@package serverimport (- "math""net/http""os""path"@@ -14,6 +13,7 @@ import ("github.com/deluan/navidrome/log""github.com/deluan/navidrome/model""github.com/deluan/navidrome/scanner"+ "github.com/deluan/navidrome/utils""github.com/go-chi/chi""github.com/go-chi/chi/middleware""github.com/go-chi/cors"@@ -65,8 +65,8 @@ func (a *Server) initRoutes() {r.Use(InjectLogger)// configure request throttling- maxRequests := math.Max(2, float64(runtime.NumCPU()))- r.Use(middleware.ThrottleBacklog(int(maxRequests), consts.RequestThrottleBacklogLimit, consts.RequestThrottleBacklogTimeout))+ maxRequests := utils.MaxInt(2, runtime.NumCPU())+ r.Use(middleware.ThrottleBacklog(maxRequests, consts.RequestThrottleBacklogLimit, consts.RequestThrottleBacklogTimeout))indexHtml := path.Join(conf.Server.BaseURL, consts.URLPathUI, "index.html")r.Get("/*", func(w http.ResponseWriter, r *http.Request) {