Skip to content

Commit 20858c7

Browse files
committed
Fix disk space warning not displayed by default in client
1 parent 9630459 commit 20858c7

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

mithril-client/src/services/snapshot.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,16 +107,14 @@ impl MithrilClientSnapshotService {
107107
}
108108
}
109109

110-
fn check_disk_space_error(&self, error: StdError) -> StdResult<()> {
110+
fn check_disk_space_error(&self, error: StdError) -> StdResult<StdError> {
111111
if let Some(SnapshotUnpackerError::NotEnoughSpace {
112112
left_space: _,
113113
pathdir: _,
114114
archive_size: _,
115115
}) = error.downcast_ref::<SnapshotUnpackerError>()
116116
{
117-
warn!("{error}");
118-
119-
Ok(())
117+
Ok(error)
120118
} else {
121119
Err(error)
122120
}
@@ -220,7 +218,8 @@ impl SnapshotService for MithrilClientSnapshotService {
220218
let unpacker = SnapshotUnpacker;
221219

222220
if let Err(e) = unpacker.check_prerequisites(&db_dir, snapshot_entity.artifact.size) {
223-
self.check_disk_space_error(e)?;
221+
progress_bar
222+
.report_step(1, &format!("Warning: {}", self.check_disk_space_error(e)?))?;
224223
}
225224

226225
std::fs::create_dir_all(&db_dir).with_context(|| {

0 commit comments

Comments
 (0)