aboutsummaryrefslogtreecommitdiff
path: root/src/garage/cli/util.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2023-06-13 17:02:42 +0200
committerAlex Auvolat <alex@adnab.me>2023-06-13 17:14:11 +0200
commit90b2d43eb49d49c3aef4f501a30cf2f181adb183 (patch)
treef7f7c15547e2f2072a1841fcb2350c272faf3c9d /src/garage/cli/util.rs
parentbf19a44fd93584d5250a2e98e5b1d3a2de6d59d1 (diff)
parent01346143ca09eab262f0d8f8a0a744c2f6d667cc (diff)
downloadgarage-90b2d43eb49d49c3aef4f501a30cf2f181adb183.tar.gz
garage-90b2d43eb49d49c3aef4f501a30cf2f181adb183.zip
Merge branch 'main' into next
Diffstat (limited to 'src/garage/cli/util.rs')
-rw-r--r--src/garage/cli/util.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/garage/cli/util.rs b/src/garage/cli/util.rs
index d87f9eab..2232d395 100644
--- a/src/garage/cli/util.rs
+++ b/src/garage/cli/util.rs
@@ -1,11 +1,11 @@
use std::collections::HashMap;
use std::time::Duration;
+use format_table::format_table;
use garage_util::background::*;
use garage_util::crdt::*;
use garage_util::data::*;
use garage_util::error::*;
-use garage_util::formater::format_table;
use garage_util::time::*;
use garage_block::manager::BlockResyncErrorInfo;
@@ -383,13 +383,18 @@ pub fn print_block_error_list(el: Vec<BlockResyncErrorInfo>) {
let mut table = vec!["Hash\tRC\tErrors\tLast error\tNext try".into()];
for e in el {
+ let next_try = if e.next_try > now {
+ tf2.convert(Duration::from_millis(e.next_try - now))
+ } else {
+ "asap".to_string()
+ };
table.push(format!(
"{}\t{}\t{}\t{}\tin {}",
hex::encode(e.hash.as_slice()),
e.refcount,
e.error_count,
tf.convert(Duration::from_millis(now - e.last_try)),
- tf2.convert(Duration::from_millis(e.next_try - now))
+ next_try
));
}
format_table(table);