This commit is contained in:
@@ -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())
|
||||
|
Reference in New Issue
Block a user