pathdebug
All checks were successful
deploy / deploy (push) Successful in 58s

This commit is contained in:
2024-10-23 16:38:34 +03:00
parent a8936c92d3
commit f28d65810d
2 changed files with 24 additions and 5 deletions

View File

@@ -138,8 +138,27 @@ pub async fn proxy_handler(
}
Ok(None) => {
warn!("cannot find stored path for: {}", filekey);
let filepath = format!("unsafe/production/{}", filekey);
// download from aws to storj
let ct_parts = content_type.split("/").collect::<Vec<&str>>();
let filepath = format!("unsafe/production/{}/{}", ct_parts[0], filekey);
match check_file_exists(&state.storj_client, &state.bucket, &filepath).await? {
true => {
warn!("file {} exists in storj", filepath);
}
false => {
warn!("file {} does not exist in storj", filepath);
}
}
match check_file_exists(&state.aws_client, &state.bucket, &filepath).await? {
true => {
warn!("file {} exists in aws", filepath);
}
false => {
warn!("file {} does not exist in aws", filepath);
}
}
match load_file_from_s3(&state.aws_client, &state.bucket, &filepath).await {
Ok(filedata) => {
thumbdata_save(filedata.clone(), &state, &filekey, content_type.to_string())