From 63c266fe2ae27db086aa5af838799edc47a5096d Mon Sep 17 00:00:00 2001 From: J Robert Ray Date: Thu, 21 Nov 2024 17:44:35 -0800 Subject: [PATCH] Prevent progress bars from showing on a no-op sync Fixes #1146. Signed-off-by: J Robert Ray --- crates/spfs/src/sync/reporter.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/crates/spfs/src/sync/reporter.rs b/crates/spfs/src/sync/reporter.rs index d83a68e2e..6fd94c725 100644 --- a/crates/spfs/src/sync/reporter.rs +++ b/crates/spfs/src/sync/reporter.rs @@ -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(); + } } }