shared/infrastructure/cache/redis/repository.rs
1use redis::aio::ConnectionManager;
2
3use crate::error::CoreError;
4
5pub struct Redis {}
6impl Redis {
7 pub async fn start(conn: &str) -> Result<ConnectionManager, CoreError> {
8 let client = redis::Client::open(conn).inspect_err(|e| {
9 tracing::error!(
10 error_code = "InternalError::Database",
11 "Failed to connect to database - {e}"
12 );
13 })?;
14 let connection = client.get_connection_manager().await?;
15
16 Ok(connection)
17 }
18}