rename LoggingMiddleware to RedisMiddleware

main
Zynh0722 2024-02-09 04:02:36 -08:00
parent 8a79e44d3d
commit 08191238aa
2 changed files with 4 additions and 4 deletions

View File

@ -3,7 +3,7 @@ use riven::{RiotApi, RiotApiConfig};
use std::error::Error; use std::error::Error;
use crate::cache::LoggingMiddleware; use crate::cache::RedisMiddleware;
pub(crate) fn fetch_api() -> Result<RiotApi, Box<dyn Error>> { pub(crate) fn fetch_api() -> Result<RiotApi, Box<dyn Error>> {
dotenvy::dotenv()?; dotenvy::dotenv()?;
@ -20,7 +20,7 @@ pub(crate) fn fetch_api() -> Result<RiotApi, Box<dyn Error>> {
.default_headers(default_headers) .default_headers(default_headers)
.build()?, .build()?,
) )
.with(LoggingMiddleware); .with(RedisMiddleware);
let config = RiotApiConfig::with_client_builder(c_builder); let config = RiotApiConfig::with_client_builder(c_builder);
Ok(RiotApi::new(config)) Ok(RiotApi::new(config))

View File

@ -2,10 +2,10 @@ use reqwest::{Request, Response};
use reqwest_middleware::{Middleware, Next, Result}; use reqwest_middleware::{Middleware, Next, Result};
use task_local_extensions::Extensions; use task_local_extensions::Extensions;
pub(crate) struct LoggingMiddleware; pub(crate) struct RedisMiddleware;
#[async_trait::async_trait] #[async_trait::async_trait]
impl Middleware for LoggingMiddleware { impl Middleware for RedisMiddleware {
async fn handle( async fn handle(
&self, &self,
req: Request, req: Request,