From 9a2bf05790f9e975455f8b353b24b8c40f731ffb Mon Sep 17 00:00:00 2001 From: Seednode Date: Tue, 26 Sep 2023 16:11:40 -0500 Subject: [PATCH] Ensure listen port log entry displays before cache import --- cmd/root.go | 2 +- cmd/web.go | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cmd/root.go b/cmd/root.go index 7c7a4ed..f13558c 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -12,7 +12,7 @@ import ( ) const ( - ReleaseVersion string = "0.96.0" + ReleaseVersion string = "0.96.1" ) var ( diff --git a/cmd/web.go b/cmd/web.go index 58e43be..7035c56 100644 --- a/cmd/web.go +++ b/cmd/web.go @@ -440,6 +440,15 @@ func ServePage(args []string) error { return ErrNoMediaFound } + listenHost := net.JoinHostPort(Bind, strconv.Itoa(Port)) + + if Verbose { + fmt.Printf("%s | SERVE: Listening on %s...\n", + time.Now().Format(logDate), + listenHost, + ) + } + cache := &fileCache{ mutex: sync.RWMutex{}, list: []string{}, @@ -457,15 +466,6 @@ func ServePage(args []string) error { mux := httprouter.New() - listenHost := net.JoinHostPort(Bind, strconv.Itoa(Port)) - - if Verbose { - fmt.Printf("%s | SERVE: Listening on %s...\n", - time.Now().Format(logDate), - listenHost, - ) - } - srv := &http.Server{ Addr: listenHost, Handler: mux,