mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-14 19:20:37 +03:00
Show in the logs how long it took to startup
This commit is contained in:
parent
d3a2f769b7
commit
804fb716db
@ -4,6 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
"path"
|
"path"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/go-chi/chi/v5"
|
"github.com/go-chi/chi/v5"
|
||||||
"github.com/go-chi/chi/v5/middleware"
|
"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 {
|
func (s *Server) Run(addr string) error {
|
||||||
s.MountRouter("WebUI", consts.URLPathUI, s.frontendAssetsHandler())
|
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)
|
return http.ListenAndServe(addr, s.router)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user