From a1cec2cd60d64208caa2cbd11d8e6f885e80f630 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Wed, 17 May 2023 13:01:37 +0200 Subject: Split format_table into separate crate and reduce k2v-client dependencies --- src/garage/cli/cmd.rs | 2 +- src/garage/cli/layout.rs | 2 +- src/garage/cli/util.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/garage/cli') diff --git a/src/garage/cli/cmd.rs b/src/garage/cli/cmd.rs index 0d735885..cb7a898c 100644 --- a/src/garage/cli/cmd.rs +++ b/src/garage/cli/cmd.rs @@ -1,8 +1,8 @@ use std::collections::HashSet; use std::time::Duration; +use format_table::format_table; use garage_util::error::*; -use garage_util::formater::format_table; use garage_rpc::layout::*; use garage_rpc::system::*; diff --git a/src/garage/cli/layout.rs b/src/garage/cli/layout.rs index 3884bb92..dc5315a1 100644 --- a/src/garage/cli/layout.rs +++ b/src/garage/cli/layout.rs @@ -1,6 +1,6 @@ +use format_table::format_table; use garage_util::crdt::Crdt; use garage_util::error::*; -use garage_util::formater::format_table; use garage_rpc::layout::*; use garage_rpc::system::*; diff --git a/src/garage/cli/util.rs b/src/garage/cli/util.rs index 2c6be2f4..7d93efe3 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; -- cgit v1.2.3 From 1ea4937c8bd952a01a2e314f27080aac31353ef0 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Mon, 12 Jun 2023 20:07:33 +0200 Subject: fix timestamps wrapping around in `garage block list-errors` (fix #584) --- src/garage/cli/util.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/garage/cli') diff --git a/src/garage/cli/util.rs b/src/garage/cli/util.rs index 7d93efe3..1140cf22 100644 --- a/src/garage/cli/util.rs +++ b/src/garage/cli/util.rs @@ -373,13 +373,18 @@ pub fn print_block_error_list(el: Vec) { 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); -- cgit v1.2.3