2
2
mirror of https://github.com/octoleo/restic.git synced 2024-12-23 11:28:54 +00:00

Limit progress bar updates to once per second on non-terminal outputs

The code accidentally checked whether stdin is a terminal instead of
stdout, the former is not relevant here as the output is printed on
stdout.
This commit is contained in:
Michael Eischer 2020-11-18 22:12:07 +01:00
parent 75eff92b56
commit 625410f003

View File

@ -16,7 +16,7 @@ func newProgressMax(show bool, max uint64, description string) *progress.Counter
} }
interval := time.Second / 60 interval := time.Second / 60
if !stdinIsTerminal() { if !stdoutIsTerminal() {
interval = time.Second interval = time.Second
} else { } else {
fps, err := strconv.ParseInt(os.Getenv("RESTIC_PROGRESS_FPS"), 10, 64) fps, err := strconv.ParseInt(os.Getenv("RESTIC_PROGRESS_FPS"), 10, 64)