Skip to content

Commit

Permalink
Merge pull request #1147 from spkenv/suppress-unneeded-progress-bars
Browse files Browse the repository at this point in the history
Prevent progress bars from showing on a no-op sync
  • Loading branch information
jrray authored Dec 3, 2024
2 parents b896216 + 63c266f commit 6cadc75
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 6cadc75

Please sign in to comment.