Skip to content

Commit

Permalink
Log retry interval (#509)
Browse files Browse the repository at this point in the history
  • Loading branch information
VirtuallyThere authored Sep 10, 2022
1 parent ab25b87 commit a71f51c
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,9 @@ impl Index {
let block = loop {
match self.block_at_height(height) {
Err(err) => {
log::error!("Failed to fetch block {height}: {err}");

let seconds = 1 << errors;

errors += 1;
let seconds = 1 << errors;
log::error!("Failed to fetch block {height}, retrying in {seconds}s: {err}");

if seconds > 120 {
log::error!("Would sleep for more than 120s, giving up");
Expand Down

0 comments on commit a71f51c

Please sign in to comment.