Ensure listen port log entry displays before cache import

This commit is contained in:
Seednode 2023-09-26 16:11:40 -05:00
parent 88a8aff135
commit 9a2bf05790
2 changed files with 10 additions and 10 deletions

View File

@ -12,7 +12,7 @@ import (
) )
const ( const (
ReleaseVersion string = "0.96.0" ReleaseVersion string = "0.96.1"
) )
var ( var (

View File

@ -440,6 +440,15 @@ func ServePage(args []string) error {
return ErrNoMediaFound 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{ cache := &fileCache{
mutex: sync.RWMutex{}, mutex: sync.RWMutex{},
list: []string{}, list: []string{},
@ -457,15 +466,6 @@ func ServePage(args []string) error {
mux := httprouter.New() 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{ srv := &http.Server{
Addr: listenHost, Addr: listenHost,
Handler: mux, Handler: mux,