From ee6c4c3e91c055c5f1820ef19ea4113afc2d0baa Mon Sep 17 00:00:00 2001 From: SinuS Von SifriduS Date: Sat, 18 Apr 2026 12:07:16 +0200 Subject: [PATCH] 0.4.2 --- Cargo.toml | 2 +- khbb_lib/src/listener.rs | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 9824a41..a54b9c9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,7 @@ members = [ ] [workspace.package] -version = "0.4.1" +version = "0.4.2" edition = "2024" license = "MIT" repository = "https://git.sasedev.com/Sasedev/khadhroony-bobot" diff --git a/khbb_lib/src/listener.rs b/khbb_lib/src/listener.rs index f6e7644..ce2ec6e 100644 --- a/khbb_lib/src/listener.rs +++ b/khbb_lib/src/listener.rs @@ -37,9 +37,7 @@ pub async fn run_listener_runtime( }; let ws_client_config = crate::KhbbSolanaWsRpcClientConfig { url: config.solana_ws_rpc_url.clone() }; - let ws_client_result = crate::KhbbSolanaWsRpcClient::new(ws_client_config); - let mut ws_client = match ws_client_result { Ok(value) => value, Err(error) => { @@ -111,6 +109,7 @@ pub async fn run_listener_runtime( subscription_id = slot_subscription_handle.subscription_id, "slot websocket subscription established" ); + let mut final_status = std::string::String::from("stopped"); loop { tokio::select! { _ = interval.tick() => { @@ -197,6 +196,8 @@ pub async fn run_listener_runtime( listener_session_id = session.id, "websocket stream ended" ); + final_status = std::string::String::from("ws_stream_ended"); + break; } Err(error) => { tracing::error!( @@ -204,6 +205,8 @@ pub async fn run_listener_runtime( error = %error, "failed to read websocket message" ); + final_status = std::string::String::from("ws_read_error"); + break; } } } @@ -286,7 +289,7 @@ pub async fn run_listener_runtime( }, } let status_update_result = - crate::storage::update_listener_session_status(pool, session.id, "stopped").await; + crate::storage::update_listener_session_status(pool, session.id, &final_status).await; match status_update_result { Ok(()) => { tracing::info!(listener_session_id = session.id, "listener runtime stopped");