Skip to content

Commit

Permalink
add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
jihuayu committed Feb 4, 2024
1 parent 6127b09 commit e9d5384
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions core/src/services/s3/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1142,6 +1142,7 @@ impl Accessor for S3Backend {
async fn rename(&self, from: &str, to: &str, _: OpRename) -> Result<RpRename> {
self.copy(from, to, OpCopy::default()).await?;
let result = self.delete(from, OpDelete::default()).await;
// Rollback when the old file delete failed.
if result.is_err() {
self.delete(to, OpDelete::default()).await?;
}
Expand Down

0 comments on commit e9d5384

Please sign in to comment.