Skip to content

Commit

Permalink
Prevent progress bars from showing on a no-op sync
Browse files Browse the repository at this point in the history
Fixes #1146.

Signed-off-by: J Robert Ray <[email protected]>
  • Loading branch information
jrray committed Nov 22, 2024
1 parent 34f9a80 commit 63c266f
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions crates/spfs/src/sync/reporter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -343,10 +343,13 @@ impl SyncReporter for ConsoleSyncReporter {
}

fn synced_env(&self, _result: &SyncEnvResult) {
let bars = self.get_bars();
bars.manifests.abandon();
bars.payloads.abandon();
bars.bytes.abandon();
// Don't cause the bars to be initialized here if they haven't already
// been, calling abandon will briefly display some zero-progress bars.
if let Some(bars) = self.bars.get() {
bars.manifests.abandon();
bars.payloads.abandon();
bars.bytes.abandon();
}
}
}

Expand Down

0 comments on commit 63c266f

Please sign in to comment.