Skip to content

Commit

Permalink
fix: remove start logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Ludo Galabru committed Aug 24, 2023
1 parent 8a5482c commit a04711a
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,6 @@ pub fn start_block_archiving_processor(
let mut empty_cycles = 0;
let mut processed_blocks = 0;

if let Ok(PostProcessorCommand::Start) = commands_rx.recv() {
let _ = events_tx.send(PostProcessorEvent::Started);
debug!(ctx.expect_logger(), "Start block indexing runloop");
}

loop {
debug!(ctx.expect_logger(), "Tick");
let (compacted_blocks, _) = match commands_rx.try_recv() {
Expand All @@ -52,7 +47,6 @@ pub fn start_block_archiving_processor(
let _ = events_tx.send(PostProcessorEvent::Terminated);
break;
}
Ok(PostProcessorCommand::Start) => unreachable!(),
Err(e) => match e {
TryRecvError::Empty => {
empty_cycles += 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,6 @@ pub fn start_inscription_indexing_processor(
open_readonly_ordhook_db_conn(&config.expected_cache_path(), &ctx).unwrap();
let mut sequence_cursor = SequenceCursor::new(&inscriptions_db_conn);

if let Ok(PostProcessorCommand::Start) = commands_rx.recv() {
let _ = events_tx.send(PostProcessorEvent::Started);
debug!(ctx.expect_logger(), "Start inscription indexing runloop");
}

loop {
let (compacted_blocks, mut blocks) = match commands_rx.try_recv() {
Ok(PostProcessorCommand::ProcessBlocks(compacted_blocks, blocks)) => {
Expand All @@ -88,11 +83,10 @@ pub fn start_inscription_indexing_processor(
let _ = events_tx.send(PostProcessorEvent::Terminated);
break;
}
Ok(PostProcessorCommand::Start) => unreachable!(),
Err(e) => match e {
TryRecvError::Empty => {
empty_cycles += 1;
if empty_cycles == 10 {
if empty_cycles == 180 {
warn!(ctx.expect_logger(), "Block processor reached expiration");
let _ = events_tx.send(PostProcessorEvent::Expired);
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,6 @@ pub fn start_transfers_recomputing_processor(
open_readwrite_ordhook_db_conn(&config.expected_cache_path(), &ctx).unwrap();
let mut empty_cycles = 0;

if let Ok(PostProcessorCommand::Start) = commands_rx.recv() {
let _ = events_tx.send(PostProcessorEvent::Started);
debug!(ctx.expect_logger(), "Start inscription indexing runloop");
}

loop {
let mut blocks = match commands_rx.try_recv() {
Ok(PostProcessorCommand::ProcessBlocks(_, blocks)) => {
Expand All @@ -53,7 +48,6 @@ pub fn start_transfers_recomputing_processor(
let _ = events_tx.send(PostProcessorEvent::Terminated);
break;
}
Ok(PostProcessorCommand::Start) => unreachable!(),
Err(e) => match e {
TryRecvError::Empty => {
empty_cycles += 1;
Expand Down

0 comments on commit a04711a

Please sign in to comment.