forked from Deuxfleurs/garage
Merge pull request 'fix timestamps wrapping around in garage block list-errors
(fix #584)' (#585) from fix-future-timestamps into main
Reviewed-on: Deuxfleurs/garage#585
This commit is contained in:
commit
fc29548933
1 changed files with 6 additions and 1 deletions
|
@ -373,13 +373,18 @@ pub fn print_block_error_list(el: Vec<BlockResyncErrorInfo>) {
|
||||||
|
|
||||||
let mut table = vec!["Hash\tRC\tErrors\tLast error\tNext try".into()];
|
let mut table = vec!["Hash\tRC\tErrors\tLast error\tNext try".into()];
|
||||||
for e in el {
|
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!(
|
table.push(format!(
|
||||||
"{}\t{}\t{}\t{}\tin {}",
|
"{}\t{}\t{}\t{}\tin {}",
|
||||||
hex::encode(e.hash.as_slice()),
|
hex::encode(e.hash.as_slice()),
|
||||||
e.refcount,
|
e.refcount,
|
||||||
e.error_count,
|
e.error_count,
|
||||||
tf.convert(Duration::from_millis(now - e.last_try)),
|
tf.convert(Duration::from_millis(now - e.last_try)),
|
||||||
tf2.convert(Duration::from_millis(e.next_try - now))
|
next_try
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
format_table(table);
|
format_table(table);
|
||||||
|
|
Loading…
Reference in a new issue