(redis: web::Data<redis::Client>)
| 4 | use serde::Deserialize; |
| 5 | |
| 6 | async fn get_from_cache(redis: web::Data<redis::Client>) -> actix_web::Result<impl Responder> { |
| 7 | let mut conn = redis |
| 8 | .get_connection_manager() |
| 9 | .await |
| 10 | .map_err(error::ErrorInternalServerError)?; |
| 11 | |
| 12 | let res = redis::Cmd::mget(&["my_domain:one", "my_domain:two", "my_domain:three"]) |
| 13 | .query_async::<Vec<String>>(&mut conn) |
| 14 | .await |
| 15 | .map_err(error::ErrorInternalServerError)?; |
| 16 | |
| 17 | Ok(HttpResponse::Ok().json(res)) |
| 18 | } |
| 19 | |
| 20 | #[derive(Deserialize)] |
| 21 | pub struct CacheInfo { |
nothing calls this directly
no outgoing calls
no test coverage detected