Skip to content

Commit ba32233

Browse files
committed
Add socket disconnection handling for IPC extractor
1 parent c1d0687 commit ba32233

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

extractors/ipc/src/lib.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,14 @@ pub async fn run(args: Args, mut shutdown_rx: watch::Receiver<bool>) -> Result<(
9696
loop {
9797
tokio::select! {
9898
_ = interval.tick() => {
99+
if ipc_session.rpc_task.is_finished() {
100+
log::error!("Lost connection to IPC socket. Exiting.");
101+
break;
102+
}
103+
99104
if let Err(e) = get_tip(&ipc_session, &nats_client).await {
100-
log::error!("Could not fetch and publish 'getHeight': {}", e)
101-
}
105+
log::error!("Could not fetch and publish 'BlockTip': {}", e)
106+
}
102107
}
103108
res = shutdown_rx.changed() => {
104109
match res {

0 commit comments

Comments
 (0)