remove cache on backups needed, too

This commit is contained in:
Bryan Stitt 2023-05-28 09:39:24 -07:00
parent 166b0d810c
commit 4597967def

View File

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