()
| 150 | } |
| 151 | |
| 152 | async fn get_async_redis_pool() -> Result<AsyncRedisPool> { |
| 153 | let pool_r = ASYNC_REDIS_POOL.read().await; |
| 154 | let pool: AsyncRedisPool = pool_r |
| 155 | .as_ref() |
| 156 | .ok_or_else(|| anyhow!("Redis connection pool is not initialized"))? |
| 157 | .clone(); |
| 158 | Ok(pool) |
| 159 | } |
| 160 | |
| 161 | pub async fn get_async_redis_conn() -> Result<AsyncRedisPoolConnection> { |
| 162 | let pool = get_async_redis_pool().await?; |
no test coverage detected