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