This commit is contained in:
parent
a2a053c582
commit
74b1be650f
|
@ -160,6 +160,7 @@ impl AppState {
|
|||
.hset::<_, &str, &str, ()>(PATH_MAPPING_KEY, aws_filekey, storj_filekey)
|
||||
.await
|
||||
.map_err(|_| ErrorInternalServerError("Failed to save path mapping in Redis"))?;
|
||||
// println!("[ok] {}", storj_filekey);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
@ -188,8 +189,8 @@ impl AppState {
|
|||
let parts: Vec<&str> = key.split('.').collect();
|
||||
let storj_filekey = parts.first().and_then(|s| s.split('/').last()).unwrap_or(parts.first().unwrap());
|
||||
|
||||
if storj_filekey.is_empty() {
|
||||
eprint!("[ERROR] empty filename: {}", key);
|
||||
if storj_filekey.is_empty() && !storj_filekey.ends_with("/") {
|
||||
eprint!("[ERROR] empty filename: {}\n", key);
|
||||
} else {
|
||||
// Проверяем, существует ли файл на Storj S3
|
||||
match check_file_exists(&self.storj_client, &self.storj_bucket, &storj_filekey).await
|
||||
|
@ -201,11 +202,11 @@ impl AppState {
|
|||
{
|
||||
eprintln!("[ERROR] save {}: {:?}", key, e);
|
||||
} else {
|
||||
println!("{}", key);
|
||||
println!("[ok] {}", key);
|
||||
}
|
||||
}
|
||||
Ok(true) => {
|
||||
println!("Already exists in Storj: {}", storj_filekey);
|
||||
println!("[skip] {}", storj_filekey);
|
||||
}
|
||||
Err(e) => {
|
||||
eprintln!(
|
||||
|
|
Loading…
Reference in New Issue
Block a user