Skip to content

Commit 3673209

Browse files
authored
Merge pull request #1192 from input-output-hk/jpraynaud/1160-fix-disk-space-warning-client
Fix disk space warning not displayed in client
2 parents 9630459 + c7af44c commit 3673209

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

mithril-client/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "mithril-client"
3-
version = "0.3.37"
3+
version = "0.3.38"
44
description = "A Mithril Client"
55
authors = { workspace = true }
66
edition = { workspace = true }

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)