Skip to content

Commit

Permalink
Added log messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicholas Rodrigues Lordello committed Nov 18, 2022
1 parent 53ced52 commit fc318ea
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions crates/shared/src/maintenance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,21 +64,24 @@ impl ServiceMaintenance {
None => blocks.next().await,
} {
tracing::debug!(
"running maintenance on block number {:?} hash {:?}",
block.number,
block.hash,
?block.number, ?block.hash,
"running maintenance",
);

let block_number = block.number.unwrap_or_default().as_u64();

metrics.last_seen_block.set(block_number as _);

if self
if let Err(err) = self
.run_maintenance()
.instrument(tracing::debug_span!("maintenance", block = block_number))
.await
.is_err()
{
tracing::debug!(
?block.number, ?block.hash, ?err,
"maintenance failed; queuing retry",
);

metrics.runs.with_label_values(&["failure"]).inc();
retry_block = Some(block);
continue;
Expand Down

0 comments on commit fc318ea

Please sign in to comment.