Skip to content

Commit

Permalink
feat: provided better error message in case "Connection refused" caus…
Browse files Browse the repository at this point in the history
…ed by Redis
  • Loading branch information
frolvanya committed Jun 9, 2024
1 parent c121d72 commit a27b364
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion rpc-server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,14 @@ async fn main() -> anyhow::Result<()> {
let blocks_info_by_finality_clone =
std::sync::Arc::clone(&server_context.blocks_info_by_finality);
let near_rpc_client_clone = near_rpc_client.clone();

let redis_client = redis::Client::open(rpc_server_config.general.redis_url.clone())?
.get_connection_manager()
.await?;
.await
.map_err(|err| {
tracing::error!("Failed to connect to Redis: {:?}", err);
err
})?;
let redis_client_clone = redis_client.clone();

// We need to update final block from Redis and Lake
Expand Down

0 comments on commit a27b364

Please sign in to comment.