mirror of
https://github.com/rclone/rclone.git
synced 2024-11-25 09:54:44 +01:00
swift: Avoid unnecessary container versioning check
Container versioning check is only needed for non-empty large objects.
This commit is contained in:
parent
7b8bbe531e
commit
a1e66cc5e8
@ -1531,14 +1531,16 @@ func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, op
|
||||
o.size = int64(inCount.BytesRead())
|
||||
}
|
||||
}
|
||||
isInContainerVersioning, _ := o.isInContainerVersioning(ctx, container)
|
||||
// If file was a large object and the container is not enable versioning then remove old/all segments
|
||||
if isLargeObject && len(segmentsContainer) > 0 && !isInContainerVersioning {
|
||||
if isLargeObject && len(segmentsContainer) > 0 {
|
||||
isInContainerVersioning, _ := o.isInContainerVersioning(ctx, container)
|
||||
if !isInContainerVersioning {
|
||||
err := o.removeSegmentsLargeObject(ctx, segmentsContainer)
|
||||
if err != nil {
|
||||
fs.Logf(o, "Failed to remove old segments - carrying on with upload: %v", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Read the metadata from the newly created object if necessary
|
||||
return o.readMetaData(ctx)
|
||||
|
Loading…
Reference in New Issue
Block a user