Better termination handling in Scanner's progress

This commit is contained in:
Deluan 2020-11-25 19:05:36 -05:00
parent 3ad36ebd2a
commit f29bb211d1
3 changed files with 36 additions and 31 deletions

View file

@ -4,6 +4,7 @@ import (
"github.com/deluan/navidrome/conf"
"github.com/deluan/navidrome/log"
"github.com/spf13/cobra"
"golang.org/x/net/context"
)
var fullRescan bool
@ -26,7 +27,7 @@ func runScanner() {
conf.Server.DevPreCacheAlbumArtwork = false
scanner := GetScanner()
_ = scanner.RescanAll(fullRescan)
_ = scanner.RescanAll(context.Background(), fullRescan)
if fullRescan {
log.Info("Finished full rescan")
} else {