diff --git a/lib/model/folder.go b/lib/model/folder.go index 57b154bb0..a78ac4b8f 100644 --- a/lib/model/folder.go +++ b/lib/model/folder.go @@ -361,6 +361,7 @@ func (f *folder) scanSubdirs(subDirs []string) error { }() f.setState(FolderScanWaiting) + defer f.setState(FolderIdle) if err := f.ioLimiter.takeWithContext(f.ctx, 1); err != nil { return err @@ -627,7 +628,6 @@ func (f *folder) scanSubdirs(subDirs []string) error { } f.ScanCompleted() - f.setState(FolderIdle) return nil }