Skip to content

Commit

Permalink
Show in the logs how long it took to startup
Browse files Browse the repository at this point in the history
  • Loading branch information
deluan committed Nov 4, 2021
1 parent d3a2f76 commit 804fb71
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion server/server.go
Expand Up @@ -4,6 +4,7 @@ import (
"fmt"
"net/http"
"path"
"time"

"github.com/go-chi/chi/v5"
"github.com/go-chi/chi/v5/middleware"
Expand Down Expand Up @@ -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)
}

Expand Down

0 comments on commit 804fb71

Please sign in to comment.