Skip to content

Commit

Permalink
update abort-multipart
Browse files Browse the repository at this point in the history
  • Loading branch information
lynnliu030 committed Sep 22, 2023
1 parent 8599c1a commit 5b84de9
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions crates/s3s-fs/src/s3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -656,10 +656,13 @@ impl S3 for FileSystem {
let prefix = format!(".upload_id-{upload_id}");
let mut iter = try_!(fs::read_dir(&self.root).await);
while let Some(entry) = try_!(iter.next_entry().await) {
let file_type = try_!(entry.file_type().await);
if file_type.is_file().not() {
continue;
}

let file_name = entry.file_name();
let name = file_name
.to_str()
.ok_or_else(|| s3_error!(InternalError, "Failed to read filename"))?;
let Some(name) = file_name.to_str() else { continue };

if name.starts_with(&prefix) {
try_!(fs::remove_file(entry.path()).await);
Expand Down

0 comments on commit 5b84de9

Please sign in to comment.