From 31a0bdad439a4575c1686f690e9e72bd44dde472 Mon Sep 17 00:00:00 2001 From: Vika Date: Mon, 26 Aug 2024 15:22:29 +0300 Subject: Add HTTP fetcher cache It just does its thing in the background, potentially speeding up things. Maybe I could also use the underlying in-memory cache implementation (Moka) to speed up my database. I heard crates.io got some good results from that. --- src/frontend/onboarding.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/frontend') diff --git a/src/frontend/onboarding.rs b/src/frontend/onboarding.rs index be1669f..a8d2ae6 100644 --- a/src/frontend/onboarding.rs +++ b/src/frontend/onboarding.rs @@ -53,7 +53,7 @@ async fn onboard( db: D, user_uid: url::Url, data: OnboardingData, - http: reqwest::Client, + http: reqwest_middleware::ClientWithMiddleware, jobset: Arc>>, ) -> Result<(), FrontendError> { // Create a user to pass to the backend @@ -126,7 +126,7 @@ async fn onboard( pub async fn post( State(db): State, Host(host): Host, - State(http): State, + State(http): State, State(jobset): State>>>, Json(data): Json, ) -> axum::response::Response { @@ -165,7 +165,7 @@ pub fn router() -> axum::routing::MethodRouter where S: Storage + FromRef + 'static, Arc>>: FromRef, - reqwest::Client: FromRef, + reqwest_middleware::ClientWithMiddleware: FromRef, St: Clone + Send + Sync + 'static, { axum::routing::get(get) -- cgit 1.4.1