From 804fb716db662f72fcac188a5485506607b7efff Mon Sep 17 00:00:00 2001 From: Deluan Date: Thu, 4 Nov 2021 13:48:38 -0400 Subject: [PATCH] Show in the logs how long it took to startup --- server/server.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server/server.go b/server/server.go index cfa7d5d27..022e52b03 100644 --- a/server/server.go +++ b/server/server.go @@ -4,6 +4,7 @@ import ( "fmt" "net/http" "path" + "time" "github.com/go-chi/chi/v5" "github.com/go-chi/chi/v5/middleware" @@ -40,9 +41,11 @@ func (s *Server) MountRouter(description, urlPath string, subRouter http.Handler }) } +var startTime = time.Now() + func (s *Server) Run(addr string) error { s.MountRouter("WebUI", consts.URLPathUI, s.frontendAssetsHandler()) - log.Info("Navidrome server is accepting requests", "address", addr) + log.Info("Navidrome server is ready!", "address", addr, "startupTime", time.Since(startTime)) return http.ListenAndServe(addr, s.router) }