refactor(redis_interface): separating redis functionality and dependent functionalities outside router crate (#15)

Co-authored-by: Sanchith Hegde
This commit is contained in:
Nishant Joshi
2022-11-28 11:40:13 +05:30
committed by GitHub
parent cc473590cb
commit 10003cd6fe
22 changed files with 544 additions and 302 deletions

View File

@ -6,7 +6,7 @@ use crate::configs::settings::{Database, Settings};
pub type PgPool = bb8::Pool<async_bb8_diesel::ConnectionManager<PgConnection>>;
pub type PgPooledConn = async_bb8_diesel::Connection<PgConnection>;
pub type RedisPool = std::sync::Arc<crate::services::redis::RedisConnectionPool>;
pub type RedisPool = std::sync::Arc<redis_interface::RedisConnectionPool>;
#[derive(Debug)]
struct TestTransaction;
@ -25,8 +25,8 @@ impl CustomizeConnection<PgPooledConn, ConnectionError> for TestTransaction {
}
}
pub async fn redis_connection(conf: &Settings) -> crate::services::redis::RedisConnectionPool {
crate::services::redis::RedisConnectionPool::new(&conf.redis).await
pub async fn redis_connection(conf: &Settings) -> redis_interface::RedisConnectionPool {
redis_interface::RedisConnectionPool::new(&conf.redis).await
}
#[allow(clippy::expect_used)]