Skip to content

Commit 84e189b

Browse files
authored
fix: kill process when a streamed block fails to index (#431)
1 parent 52d2464 commit 84e189b

File tree

1 file changed

+4
-5
lines changed
  • components/ordhook-core/src/service

1 file changed

+4
-5
lines changed

components/ordhook-core/src/service/mod.rs

+4-5
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use crate::db::cursor::{BlockBytesCursor, TransactionBytesCursor};
1717
use crate::db::ordinals_pg;
1818
use crate::utils::bitcoind::bitcoind_wait_for_chain_tip;
1919
use crate::utils::monitoring::{start_serving_prometheus_metrics, PrometheusMonitoring};
20-
use crate::{try_error, try_info};
20+
use crate::{try_crit, try_error, try_info};
2121
use chainhook_postgres::{pg_begin, pg_pool, pg_pool_client};
2222
use chainhook_sdk::observer::{
2323
start_event_observer, BitcoinBlockDataCached, ObserverEvent, ObserverSidecar,
@@ -205,15 +205,14 @@ impl Service {
205205
let _ = block_mutator_out_tx.send(blocks_to_mutate);
206206
},
207207
Err(e) => {
208-
try_error!(ctx, "block mutation error: {e}");
208+
try_crit!(ctx, "Error indexing streamed block: {e}");
209+
std::process::exit(1);
209210
},
210211
};
211212
}
212213
}
213214
recv(chain_event_notifier_rx) -> _msg => {
214-
// if let Ok(command) = msg {
215-
// chainhook_sidecar_mutate_ordhook_db(command, &config, &ctx)
216-
// }
215+
// No action required.
217216
}
218217
}
219218
}

0 commit comments

Comments
 (0)