This commit is contained in:
parent
e9e0815af8
commit
525dcdd54d
|
@ -60,8 +60,12 @@ pub async fn proxy_handler(
|
|||
)
|
||||
.await
|
||||
{
|
||||
Ok(true) => serve_file(thumb_filename, &state).await,
|
||||
Ok(true) => {
|
||||
warn!("serve existed thumb file: {}", thumb_filename);
|
||||
serve_file(thumb_filename, &state).await
|
||||
},
|
||||
Ok(false) => {
|
||||
warn!("generate new thumb files: {}", stored_path);
|
||||
if let Ok(filedata) = load_file_from_s3(
|
||||
&state.storj_client,
|
||||
&state.bucket,
|
||||
|
@ -69,6 +73,8 @@ pub async fn proxy_handler(
|
|||
)
|
||||
.await
|
||||
{
|
||||
warn!("original file loaded: {} bytes", filedata.len());
|
||||
warn!("generate new thumb files");
|
||||
thumbdata_save(
|
||||
filedata.clone(),
|
||||
&state,
|
||||
|
@ -76,6 +82,7 @@ pub async fn proxy_handler(
|
|||
content_type.to_string(),
|
||||
)
|
||||
.await;
|
||||
warn!("serve new thumb file: {}", thumb_filename);
|
||||
serve_file(thumb_filename, &state).await
|
||||
} else {
|
||||
Err(ErrorInternalServerError(
|
||||
|
|
Loading…
Reference in New Issue
Block a user