proxylogs
All checks were successful
deploy / deploy (push) Successful in 57s

This commit is contained in:
Untone 2024-10-23 15:45:05 +03:00
parent f3a3804e5a
commit 322c50de57

View File

@ -103,6 +103,7 @@ pub async fn proxy_handler(
}; };
} }
// not image passing thumb generation // not image passing thumb generation
warn!("file is not an image");
} }
// we need to download what stored_path keeping in aws // we need to download what stored_path keeping in aws
@ -127,10 +128,14 @@ pub async fn proxy_handler(
Ok(HttpResponse::Ok().content_type(content_type).body(filedata)) Ok(HttpResponse::Ok().content_type(content_type).body(filedata))
} }
Err(err) => Err(ErrorInternalServerError(err)), Err(err) => {
error!("cannot download {} from aws: {}", stored_path, err);
Err(ErrorInternalServerError(err))
},
}; };
} }
Ok(None) => { Ok(None) => {
warn!("download from aws to storj: {}", requested_res);
// download from aws to storj // download from aws to storj
match load_file_from_s3(&state.aws_client, &state.bucket, &requested_res).await { match load_file_from_s3(&state.aws_client, &state.bucket, &requested_res).await {
Ok(filedata) => { Ok(filedata) => {
@ -150,10 +155,16 @@ pub async fn proxy_handler(
} }
Ok(HttpResponse::Ok().content_type(content_type).body(filedata)) Ok(HttpResponse::Ok().content_type(content_type).body(filedata))
}, },
Err(e) => Err(ErrorInternalServerError(e)), Err(e) => {
error!("cannot download {} from aws: {}", requested_res, e);
Err(ErrorInternalServerError(e))
},
} }
}, },
Err(e) => Err(ErrorInternalServerError(e)) Err(e) => {
error!("cannot get path from aws: {}", e);
Err(ErrorInternalServerError(e))
}
} }
} }
@ -179,6 +190,7 @@ async fn thumbdata_save(
} }
}; };
warn!("generate thumbnails for {}", filename);
//actix::spawn(async move { //actix::spawn(async move {
match generate_thumbnails(&img).await { match generate_thumbnails(&img).await {
Ok(thumbnails_bytes) => { Ok(thumbnails_bytes) => {