fix: remove start logic

This commit is contained in:
Ludo Galabru
2023-08-24 19:38:42 +02:00
parent 8a5482c131
commit a04711ad7c
3 changed files with 1 additions and 19 deletions

View File

@@ -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() {
@@ -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;

View File

@@ -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)) => {
@@ -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;

View File

@@ -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)) => {
@@ -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;