Skip to content

Commit

Permalink
s3: do not copy object to itself if metadata is already correct
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitor Gomes committed Aug 3, 2023
1 parent 3bcdd2b commit c2d16a6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions backend/s3/s3.go
Expand Up @@ -5132,6 +5132,12 @@ func (o *Object) SetModTime(ctx context.Context, modTime time.Time) error {
if err != nil {
return err
}

// Do not copy to itself if metadata is already correct ?
if o.meta[metaMtime] == swift.TimeToFloatString(modTime) {
return nil
}

o.meta[metaMtime] = swift.TimeToFloatString(modTime)

// Can't update metadata here, so return this error to force a recopy
Expand Down

0 comments on commit c2d16a6

Please sign in to comment.