0.4.2
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user