forked from TrueCloudLab/rclone
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
1 changed files with 7 additions and 5 deletions
|
@ -1531,12 +1531,14 @@ func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, op
|
||||||
o.size = int64(inCount.BytesRead())
|
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 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 {
|
||||||
err := o.removeSegmentsLargeObject(ctx, segmentsContainer)
|
isInContainerVersioning, _ := o.isInContainerVersioning(ctx, container)
|
||||||
if err != nil {
|
if !isInContainerVersioning {
|
||||||
fs.Logf(o, "Failed to remove old segments - carrying on with upload: %v", err)
|
err := o.removeSegmentsLargeObject(ctx, segmentsContainer)
|
||||||
|
if err != nil {
|
||||||
|
fs.Logf(o, "Failed to remove old segments - carrying on with upload: %v", err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue