remove todos

feature/v32-tokens
Edward Shen 2021-04-18 17:11:30 -04:00
parent 6717fbe20b
commit de17c738d2
Signed by: edward
GPG Key ID: 19182661E818369F
2 changed files with 9 additions and 2 deletions

4
src/cache/fs.rs vendored
View File

@ -1,3 +1,4 @@
use actix_web::HttpResponse;
use bytes::BytesMut;
use futures::{Future, Stream, StreamExt};
use once_cell::sync::Lazy;
@ -158,8 +159,9 @@ impl Stream for FsStream {
}
impl From<UpstreamError> for actix_web::Error {
#[inline]
fn from(_: UpstreamError) -> Self {
todo!()
HttpResponse::BadGateway().finish().into()
}
}

View File

@ -245,7 +245,12 @@ async fn fetch_image(
let (stream, metadata) = {
match cache.lock().put(key, Box::new(body), metadata).await {
Ok((stream, metadata)) => (stream, *metadata),
Err(_) => todo!(),
Err(e) => {
warn!("Failed to insert into cache: {}", e);
return ServerResponse::HttpResponse(
HttpResponse::InternalServerError().finish(),
);
}
}
};