mirror of
https://github.com/rclone/rclone.git
synced 2025-01-11 16:58:24 +01:00
s3: skip SetModTime for objects > 5GB - fixes #534
This commit is contained in:
parent
e0aa4bb492
commit
a67c7461ee
12
s3/s3.go
12
s3/s3.go
@ -150,9 +150,10 @@ func init() {
|
|||||||
|
|
||||||
// Constants
|
// Constants
|
||||||
const (
|
const (
|
||||||
metaMtime = "Mtime" // the meta key to store mtime in - eg X-Amz-Meta-Mtime
|
metaMtime = "Mtime" // the meta key to store mtime in - eg X-Amz-Meta-Mtime
|
||||||
listChunkSize = 1024 // number of items to read at once
|
listChunkSize = 1024 // number of items to read at once
|
||||||
maxRetries = 10 // number of retries to make of operations
|
maxRetries = 10 // number of retries to make of operations
|
||||||
|
maxSizeForCopy = 5 * 1024 * 1024 * 1024 // The maximum size of object we can COPY
|
||||||
)
|
)
|
||||||
|
|
||||||
// Fs represents a remote s3 server
|
// Fs represents a remote s3 server
|
||||||
@ -751,6 +752,11 @@ func (o *Object) SetModTime(modTime time.Time) error {
|
|||||||
}
|
}
|
||||||
o.meta[metaMtime] = aws.String(swift.TimeToFloatString(modTime))
|
o.meta[metaMtime] = aws.String(swift.TimeToFloatString(modTime))
|
||||||
|
|
||||||
|
if o.bytes >= maxSizeForCopy {
|
||||||
|
fs.Debug(o, "SetModTime is unsupported for objects bigger than %v bytes", fs.SizeSuffix(maxSizeForCopy))
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
// Guess the content type
|
// Guess the content type
|
||||||
contentType := fs.MimeType(o)
|
contentType := fs.MimeType(o)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user