lib: Print nicely rounded durations (#6756)

This commit is contained in:
Simon Frei
2020-06-18 10:55:41 +02:00
committed by GitHub
parent 4812fd3ec1
commit 8cf9d91ed4
3 changed files with 20 additions and 2 deletions
+2 -1
View File
@@ -28,6 +28,7 @@ import (
"github.com/syncthing/syncthing/lib/scanner"
"github.com/syncthing/syncthing/lib/stats"
"github.com/syncthing/syncthing/lib/sync"
"github.com/syncthing/syncthing/lib/util"
"github.com/syncthing/syncthing/lib/watchaggregator"
"github.com/thejerf/suture"
@@ -330,7 +331,7 @@ func (f *folder) pull() (success bool) {
// Pulling failed, try again later.
delay := f.pullPause + time.Since(startTime)
l.Infof("Folder %v isn't making sync progress - retrying in %v.", f.Description(), delay.Truncate(time.Second))
l.Infof("Folder %v isn't making sync progress - retrying in %v.", f.Description(), util.NiceDurationString(delay))
f.pullFailTimer.Reset(delay)
return false
}