remove cache on /status and /health for now

This commit is contained in:
Bryan Stitt 2023-05-28 09:38:51 -07:00
parent 7cb07cc49f
commit 166b0d810c

@ -31,12 +31,15 @@ pub async fn health(
Extension(app): Extension<Arc<Web3ProxyApp>>,
Extension(cache): Extension<Arc<ResponseCache>>,
) -> impl IntoResponse {
let (code, content_type, body) = cache
.get_or_insert_async::<Infallible, _>(&ResponseCacheKey::Health, async move {
Ok(_health(app).await)
})
.await
.expect("this cache get is infallible");
// let (code, content_type, body) = cache
// .get_or_insert_async::<Infallible, _>(&ResponseCacheKey::Health, async move {
// Ok(_health(app).await)
// })
// .await
// .expect("this cache get is infallible");
// TODO: cache this once new TTLs work
let (code, content_type, body) = _health(app).await;
Response::builder()
.status(code)
@ -115,12 +118,15 @@ pub async fn status(
Extension(app): Extension<Arc<Web3ProxyApp>>,
Extension(cache): Extension<Arc<ResponseCache>>,
) -> impl IntoResponse {
let (code, content_type, body) = cache
.get_or_insert_async::<Infallible, _>(&ResponseCacheKey::Status, async move {
Ok(_status(app).await)
})
.await
.expect("this cache get is infallible");
// let (code, content_type, body) = cache
// .get_or_insert_async::<Infallible, _>(&ResponseCacheKey::Status, async move {
// Ok(_status(app).await)
// })
// .await
// .expect("this cache get is infallible");
// TODO: cache this once new TTLs work
let (code, content_type, body) = _status(app).await;
Response::builder()
.status(code)