Skip to content

Commit

Permalink
chore: log adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
Ludo Galabru committed Aug 4, 2023
1 parent deaa739 commit dac9eb6
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 22 deletions.
7 changes: 0 additions & 7 deletions components/hord-cli/src/core/pipeline/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,13 +194,6 @@ pub async fn download_and_pipeline_blocks(
let mut compacted_blocks = vec![];
let mut blocks = vec![];
while let Some((block, compacted_block)) = inbox.remove(&inbox_cursor) {
cloned_ctx.try_log(|logger| {
info!(
logger,
"Adding block #{inbox_cursor} to next sequence (# blocks inboxed: {})",
inbox.len()
)
});
compacted_blocks.push((inbox_cursor, compacted_block));
blocks.push(block);
inbox_cursor += 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ pub fn store_compacted_blocks(

for (block_height, compacted_block) in compacted_blocks.into_iter() {
insert_entry_in_blocks(block_height as u32, &compacted_block, &blocks_db_rw, &ctx);
info!(ctx.expect_logger(), "Block #{block_height} saved to disk");
ctx.try_log(|logger| {
info!(logger, "Block #{block_height} saved to disk");
});
}

if let Err(e) = blocks_db_rw.flush() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,11 @@ pub fn start_inscription_indexing_processor(

store_compacted_blocks(compacted_blocks, &blocks_db_rw, &Context::empty());

// Early return
if blocks.is_empty() {
continue;
}

info!(ctx.expect_logger(), "Processing {} blocks", blocks.len());

blocks = process_blocks(
Expand Down Expand Up @@ -182,7 +187,7 @@ pub fn process_blocks(
ctx.try_log(|logger| {
info!(
logger,
"Block #{} revealed {} inscriptions [{}]",
"Block #{} processed and revealed {} inscriptions [{}]",
block.block_identifier.index,
inscriptions_revealed.len(),
inscriptions_revealed.join(", ")
Expand All @@ -201,12 +206,12 @@ pub fn process_blocks(
} else {
match inscriptions_db_tx.commit() {
Ok(_) => {
ctx.try_log(|logger| {
info!(
logger,
"Updates saved for block {}", block.block_identifier.index,
)
});
// ctx.try_log(|logger| {
// info!(
// logger,
// "Updates saved for block {}", block.block_identifier.index,
// )
// });
}
Err(e) => {
ctx.try_log(|logger| {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,13 +245,6 @@ pub fn parallelize_inscription_data_computations(
let _ = handle.join();
}
});
} else {
ctx.try_log(|logger| {
info!(
logger,
"No inscriptions to index in block #{}", block.block_identifier.index
)
});
}
Ok(has_transactions_to_process)
}
Expand Down

0 comments on commit dac9eb6

Please sign in to comment.