This commit is contained in:
parent
7fc29f6b7e
commit
9b2fa3ac6b
|
@ -92,6 +92,7 @@ pub async fn proxy_handler(
|
||||||
warn!("serve new thumb file: {}", thumb_filename);
|
warn!("serve new thumb file: {}", thumb_filename);
|
||||||
serve_file(thumb_filename, &state).await
|
serve_file(thumb_filename, &state).await
|
||||||
} else {
|
} else {
|
||||||
|
error!("cannot generate thumbnail");
|
||||||
Err(ErrorInternalServerError(
|
Err(ErrorInternalServerError(
|
||||||
"cannot generate thumbnail",
|
"cannot generate thumbnail",
|
||||||
))
|
))
|
||||||
|
@ -121,7 +122,7 @@ pub async fn proxy_handler(
|
||||||
content_type,
|
content_type,
|
||||||
)
|
)
|
||||||
.await {
|
.await {
|
||||||
warn!("cannot upload to storj: {}", e);
|
error!("cannot upload to storj: {}", e);
|
||||||
} else {
|
} else {
|
||||||
warn!("file {} uploaded to storj", filekey);
|
warn!("file {} uploaded to storj", filekey);
|
||||||
}
|
}
|
||||||
|
@ -139,7 +140,7 @@ pub async fn proxy_handler(
|
||||||
Ok(None) => {
|
Ok(None) => {
|
||||||
warn!("cannot find stored path for: {}", filekey);
|
warn!("cannot find stored path for: {}", filekey);
|
||||||
let ct_parts = content_type.split("/").collect::<Vec<&str>>();
|
let ct_parts = content_type.split("/").collect::<Vec<&str>>();
|
||||||
let filepath = format!("production/{}/{}", ct_parts[0], filekey);
|
let filepath = format!("production/{}/{}.{}", ct_parts[0], base_filename, extension); // NOTE: original ext
|
||||||
|
|
||||||
match check_file_exists(&state.storj_client, &state.bucket, &filepath).await? {
|
match check_file_exists(&state.storj_client, &state.bucket, &filepath).await? {
|
||||||
true => {
|
true => {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user