about summary refs log tree commit diff
path: root/src/lib.rs
diff options
context:
space:
mode:
authorVika <vika@fireburn.ru>2024-08-26 15:22:29 +0300
committerVika <vika@fireburn.ru>2024-08-26 15:23:22 +0300
commit31a0bdad439a4575c1686f690e9e72bd44dde472 (patch)
tree6b8c9132c19445d997bd75964604b069ffbd573f /src/lib.rs
parentc79e950ca22c7a957c11e510700664327b042115 (diff)
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.
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 596ffc0..5fe3b18 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -36,7 +36,7 @@ Q: JobQueue<webmentions::Webmention> + Sized
     pub storage: S,
     pub media_store: M,
     pub job_queue: Q,
-    pub http: reqwest::Client,
+    pub http: reqwest_middleware::ClientWithMiddleware,
     pub background_jobs: Arc<Mutex<JoinSet<()>>>,
     pub cookie_key: Key,
     pub session_store: SessionStore
@@ -156,7 +156,7 @@ where A: AuthBackend, S: Storage, M: MediaStore, Q: JobQueue<webmentions::Webmen
     }
 }
 
-impl<A, S, M, Q> FromRef<AppState<A, S, M, Q>> for reqwest::Client
+impl<A, S, M, Q> FromRef<AppState<A, S, M, Q>> for reqwest_middleware::ClientWithMiddleware
 where A: AuthBackend, S: Storage, M: MediaStore, Q: JobQueue<webmentions::Webmention>
 {
     fn from_ref(input: &AppState<A, S, M, Q>) -> Self {
@@ -291,7 +291,7 @@ A: AuthBackend + 'static + FromRef<St>,
 S: Storage + 'static + FromRef<St>,
 M: MediaStore + 'static + FromRef<St>,
 Q: kittybox_util::queue::JobQueue<crate::webmentions::Webmention> + FromRef<St>,
-reqwest::Client: FromRef<St>,
+reqwest_middleware::ClientWithMiddleware: FromRef<St>,
 Arc<Mutex<JoinSet<()>>>: FromRef<St>,
 crate::SessionStore: FromRef<St>,
 axum_extra::extract::cookie::Key: FromRef<St>,