diff --git a/cmd/syncthing/verboseservice.go b/cmd/syncthing/verboseservice.go index c47e54b78..0b99a42b7 100644 --- a/cmd/syncthing/verboseservice.go +++ b/cmd/syncthing/verboseservice.go @@ -154,7 +154,7 @@ func (s *verboseService) formatEvent(ev events.Event) string { if total > 0 { pct = 100 * current / total } - return fmt.Sprintf("Scanning folder %q, %d%% done (%.01f MB/s)", folder, pct, rate) + return fmt.Sprintf("Scanning folder %q, %d%% done (%.01f MiB/s)", folder, pct, rate) case events.DevicePaused: data := ev.Data.(map[string]string) diff --git a/lib/scanner/walk.go b/lib/scanner/walk.go index 7017508f7..6eaa5ee15 100644 --- a/lib/scanner/walk.go +++ b/lib/scanner/walk.go @@ -169,13 +169,14 @@ func (w *walker) walk() (chan protocol.FileInfo, error) { realToHashChan := make(chan protocol.FileInfo) done := make(chan struct{}) progress := newByteCounter() - defer progress.Close() newParallelHasher(w.Dir, w.BlockSize, w.Hashers, finishedChan, realToHashChan, progress, done, w.Cancel) // A routine which actually emits the FolderScanProgress events // every w.ProgressTicker ticks, until the hasher routines terminate. go func() { + defer progress.Close() + for { select { case <-done: @@ -185,7 +186,7 @@ func (w *walker) walk() (chan protocol.FileInfo, error) { case <-ticker.C: current := progress.Total() rate := progress.Rate() - l.Debugf("Walk %s %s current progress %d/%d at %.01f MB/s (%d%%)", w.Dir, w.Subs, current, total, rate/1024/1024, current*100/total) + l.Debugf("Walk %s %s current progress %d/%d at %.01f MiB/s (%d%%)", w.Dir, w.Subs, current, total, rate/1024/1024, current*100/total) events.Default.Log(events.FolderScanProgress, map[string]interface{}{ "folder": w.Folder, "current": current,