From a3e8e89af71632f31895a688e82c1ab091b11c2f Mon Sep 17 00:00:00 2001 From: godmodegalactus Date: Wed, 17 Jan 2024 21:40:10 +0100 Subject: [PATCH] Avoid panicking and reconnect --- src/grpc_subscription_autoreconnect.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/grpc_subscription_autoreconnect.rs b/src/grpc_subscription_autoreconnect.rs index a9fb0fb..f744e66 100644 --- a/src/grpc_subscription_autoreconnect.rs +++ b/src/grpc_subscription_autoreconnect.rs @@ -214,7 +214,8 @@ pub fn create_geyser_reconnecting_stream( (ConnectionState::WaitReconnect(attempt), Message::Connecting(attempt)) }, Err(geyser_grpc_task_error) => { - panic!("! task aborted - should not happen :{geyser_grpc_task_error}"); + log::error!("! task aborted - should not happen :{geyser_grpc_task_error}"); + (ConnectionState::WaitReconnect(attempt), Message::Connecting(attempt)) } } @@ -234,7 +235,8 @@ pub fn create_geyser_reconnecting_stream( } None => { // should not arrive here, Mean the stream close. - panic!("geyser stream closed on {} - retrying", grpc_source); + log::error!("! ready stream closed"); + (ConnectionState::WaitReconnect(attempt), Message::Connecting(attempt)) } }