Ensure listen port log entry displays before cache import
This commit is contained in:
parent
f782846f02
commit
2f2d7f90d3
20
cmd/cache.go
20
cmd/cache.go
|
@ -181,3 +181,23 @@ func registerCacheHandlers(mux *httprouter.Router, args []string, errorChannel c
|
|||
|
||||
return nil
|
||||
}
|
||||
|
||||
func importCache(args []string) error {
|
||||
skipIndex := false
|
||||
|
||||
if CacheFile != "" {
|
||||
err := cache.Import(CacheFile)
|
||||
if err == nil {
|
||||
skipIndex = true
|
||||
}
|
||||
}
|
||||
|
||||
if !skipIndex {
|
||||
_, err := fileList(args, &filters{}, "")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ import (
|
|||
)
|
||||
|
||||
const (
|
||||
ReleaseVersion string = "0.95.1"
|
||||
ReleaseVersion string = "0.95.2"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
25
cmd/web.go
25
cmd/web.go
|
@ -436,24 +436,6 @@ func ServePage(args []string) error {
|
|||
return ErrNoMediaFound
|
||||
}
|
||||
|
||||
skipIndex := false
|
||||
|
||||
if CacheFile != "" {
|
||||
err := cache.Import(CacheFile)
|
||||
if err == nil {
|
||||
skipIndex = true
|
||||
}
|
||||
}
|
||||
|
||||
if !skipIndex {
|
||||
_, err := fileList(args, &filters{}, "")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
mux := httprouter.New()
|
||||
|
||||
listenHost := net.JoinHostPort(Bind, strconv.Itoa(Port))
|
||||
|
||||
if Verbose {
|
||||
|
@ -463,6 +445,13 @@ func ServePage(args []string) error {
|
|||
)
|
||||
}
|
||||
|
||||
err = importCache(args)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
mux := httprouter.New()
|
||||
|
||||
srv := &http.Server{
|
||||
Addr: listenHost,
|
||||
Handler: mux,
|
||||
|
|
Loading…
Reference in New Issue