mirror of
https://github.com/alexgo-io/bitcoin-indexer.git
synced 2026-05-05 05:39:45 +08:00
fix: kill process when a streamed block fails to index (#431)
This commit is contained in:
@@ -17,7 +17,7 @@ use crate::db::cursor::{BlockBytesCursor, TransactionBytesCursor};
|
|||||||
use crate::db::ordinals_pg;
|
use crate::db::ordinals_pg;
|
||||||
use crate::utils::bitcoind::bitcoind_wait_for_chain_tip;
|
use crate::utils::bitcoind::bitcoind_wait_for_chain_tip;
|
||||||
use crate::utils::monitoring::{start_serving_prometheus_metrics, PrometheusMonitoring};
|
use crate::utils::monitoring::{start_serving_prometheus_metrics, PrometheusMonitoring};
|
||||||
use crate::{try_error, try_info};
|
use crate::{try_crit, try_error, try_info};
|
||||||
use chainhook_postgres::{pg_begin, pg_pool, pg_pool_client};
|
use chainhook_postgres::{pg_begin, pg_pool, pg_pool_client};
|
||||||
use chainhook_sdk::observer::{
|
use chainhook_sdk::observer::{
|
||||||
start_event_observer, BitcoinBlockDataCached, ObserverEvent, ObserverSidecar,
|
start_event_observer, BitcoinBlockDataCached, ObserverEvent, ObserverSidecar,
|
||||||
@@ -205,15 +205,14 @@ impl Service {
|
|||||||
let _ = block_mutator_out_tx.send(blocks_to_mutate);
|
let _ = block_mutator_out_tx.send(blocks_to_mutate);
|
||||||
},
|
},
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
try_error!(ctx, "block mutation error: {e}");
|
try_crit!(ctx, "Error indexing streamed block: {e}");
|
||||||
|
std::process::exit(1);
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
recv(chain_event_notifier_rx) -> _msg => {
|
recv(chain_event_notifier_rx) -> _msg => {
|
||||||
// if let Ok(command) = msg {
|
// No action required.
|
||||||
// chainhook_sidecar_mutate_ordhook_db(command, &config, &ctx)
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user