diff --git a/lib/model/folder.go b/lib/model/folder.go index 01d1fc1c1..b2977cf10 100644 --- a/lib/model/folder.go +++ b/lib/model/folder.go @@ -348,6 +348,7 @@ func (f *folder) scanSubdirs(subDirs []string) error { ProgressTickIntervalS: f.ScanProgressIntervalS, LocalFlags: f.localFlags, ModTimeWindow: f.ModTimeWindow(), + EventLogger: f.evLogger, }) batchFn := func(fs []protocol.FileInfo) error { diff --git a/lib/scanner/walk.go b/lib/scanner/walk.go index 3be171306..b46240b40 100644 --- a/lib/scanner/walk.go +++ b/lib/scanner/walk.go @@ -57,7 +57,7 @@ type Config struct { // Modification time is to be considered unchanged if the difference is lower. ModTimeWindow time.Duration // Event logger to which the scan progress events are sent - EvLogger events.Logger + EventLogger events.Logger } type CurrentFiler interface { @@ -170,7 +170,7 @@ func (w *walker) walk(ctx context.Context) chan ScanResult { current := progress.Total() rate := progress.Rate() l.Debugf("Walk %s %s current progress %d/%d at %.01f MiB/s (%d%%)", w.Folder, w.Subs, current, total, rate/1024/1024, current*100/total) - w.EvLogger.Log(events.FolderScanProgress, map[string]interface{}{ + w.EventLogger.Log(events.FolderScanProgress, map[string]interface{}{ "folder": w.Folder, "current": current, "total": total, diff --git a/lib/scanner/walk_test.go b/lib/scanner/walk_test.go index 4b2bd26b1..5c01eba3d 100644 --- a/lib/scanner/walk_test.go +++ b/lib/scanner/walk_test.go @@ -788,8 +788,8 @@ func testConfig() Config { evLogger := events.NewLogger() go evLogger.Serve() return Config{ - Filesystem: testFs, - Hashers: 2, - EvLogger: evLogger, + Filesystem: testFs, + Hashers: 2, + EventLogger: evLogger, } }