Only start the cache warming after all folders were scanned
This commit is contained in:
@@ -122,6 +122,7 @@ func (s *scanner) RescanAll(fullRescan bool) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *scanner) rescanAll(fullRescan bool) {
|
func (s *scanner) rescanAll(fullRescan bool) {
|
||||||
|
defer s.cacheWarmer.Flush(context.Background())
|
||||||
var hasError bool
|
var hasError bool
|
||||||
for folder := range s.folders {
|
for folder := range s.folders {
|
||||||
err := s.rescan(folder, fullRescan)
|
err := s.rescan(folder, fullRescan)
|
||||||
|
|||||||
@@ -65,7 +65,6 @@ const (
|
|||||||
// Delete all empty albums, delete all empty artists, clean-up playlists
|
// Delete all empty albums, delete all empty artists, clean-up playlists
|
||||||
func (s *TagScanner) Scan(ctx context.Context, lastModifiedSince time.Time) error {
|
func (s *TagScanner) Scan(ctx context.Context, lastModifiedSince time.Time) error {
|
||||||
ctx = s.withAdminUser(ctx)
|
ctx = s.withAdminUser(ctx)
|
||||||
defer s.cacheWarmer.Flush(ctx)
|
|
||||||
|
|
||||||
start := time.Now()
|
start := time.Now()
|
||||||
allFSDirs, err := s.getDirTree(ctx)
|
allFSDirs, err := s.getDirTree(ctx)
|
||||||
|
|||||||
Reference in New Issue
Block a user