0.4.2
This commit is contained in:
@@ -8,7 +8,7 @@ members = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[workspace.package]
|
[workspace.package]
|
||||||
version = "0.4.1"
|
version = "0.4.2"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
repository = "https://git.sasedev.com/Sasedev/khadhroony-bobot"
|
repository = "https://git.sasedev.com/Sasedev/khadhroony-bobot"
|
||||||
|
|||||||
@@ -37,9 +37,7 @@ pub async fn run_listener_runtime(
|
|||||||
};
|
};
|
||||||
let ws_client_config =
|
let ws_client_config =
|
||||||
crate::KhbbSolanaWsRpcClientConfig { url: config.solana_ws_rpc_url.clone() };
|
crate::KhbbSolanaWsRpcClientConfig { url: config.solana_ws_rpc_url.clone() };
|
||||||
|
|
||||||
let ws_client_result = crate::KhbbSolanaWsRpcClient::new(ws_client_config);
|
let ws_client_result = crate::KhbbSolanaWsRpcClient::new(ws_client_config);
|
||||||
|
|
||||||
let mut ws_client = match ws_client_result {
|
let mut ws_client = match ws_client_result {
|
||||||
Ok(value) => value,
|
Ok(value) => value,
|
||||||
Err(error) => {
|
Err(error) => {
|
||||||
@@ -111,6 +109,7 @@ pub async fn run_listener_runtime(
|
|||||||
subscription_id = slot_subscription_handle.subscription_id,
|
subscription_id = slot_subscription_handle.subscription_id,
|
||||||
"slot websocket subscription established"
|
"slot websocket subscription established"
|
||||||
);
|
);
|
||||||
|
let mut final_status = std::string::String::from("stopped");
|
||||||
loop {
|
loop {
|
||||||
tokio::select! {
|
tokio::select! {
|
||||||
_ = interval.tick() => {
|
_ = interval.tick() => {
|
||||||
@@ -197,6 +196,8 @@ pub async fn run_listener_runtime(
|
|||||||
listener_session_id = session.id,
|
listener_session_id = session.id,
|
||||||
"websocket stream ended"
|
"websocket stream ended"
|
||||||
);
|
);
|
||||||
|
final_status = std::string::String::from("ws_stream_ended");
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
Err(error) => {
|
Err(error) => {
|
||||||
tracing::error!(
|
tracing::error!(
|
||||||
@@ -204,6 +205,8 @@ pub async fn run_listener_runtime(
|
|||||||
error = %error,
|
error = %error,
|
||||||
"failed to read websocket message"
|
"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 =
|
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 {
|
match status_update_result {
|
||||||
Ok(()) => {
|
Ok(()) => {
|
||||||
tracing::info!(listener_session_id = session.id, "listener runtime stopped");
|
tracing::info!(listener_session_id = session.id, "listener runtime stopped");
|
||||||
|
|||||||
Reference in New Issue
Block a user