This commit is contained in:
parent
f3a3804e5a
commit
322c50de57
|
@ -103,6 +103,7 @@ pub async fn proxy_handler(
|
|||
};
|
||||
}
|
||||
// not image passing thumb generation
|
||||
warn!("file is not an image");
|
||||
}
|
||||
|
||||
// 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))
|
||||
}
|
||||
Err(err) => Err(ErrorInternalServerError(err)),
|
||||
Err(err) => {
|
||||
error!("cannot download {} from aws: {}", stored_path, err);
|
||||
Err(ErrorInternalServerError(err))
|
||||
},
|
||||
};
|
||||
}
|
||||
Ok(None) => {
|
||||
warn!("download from aws to storj: {}", requested_res);
|
||||
// download from aws to storj
|
||||
match load_file_from_s3(&state.aws_client, &state.bucket, &requested_res).await {
|
||||
Ok(filedata) => {
|
||||
|
@ -150,10 +155,16 @@ pub async fn proxy_handler(
|
|||
}
|
||||
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 {
|
||||
match generate_thumbnails(&img).await {
|
||||
Ok(thumbnails_bytes) => {
|
||||
|
|
Loading…
Reference in New Issue
Block a user