s3,swift: Add --use-server-modtime

`--use-server-modtime` stops s3 and swift retrieving the modtime from metadata which enables a fast sync mode with the `--update` flag.
This commit is contained in:
Peter Baumgartner 2018-04-13 06:32:17 -06:00 committed by Nick Craig-Wood
parent 6b67489133
commit 1db68571fd
7 changed files with 47 additions and 0 deletions

View file

@ -719,6 +719,9 @@ func (o *Object) readMetaData() (err error) {
// It attempts to read the objects mtime and if that isn't present the
// LastModified returned in the http headers
func (o *Object) ModTime() time.Time {
if fs.Config.UseServerModTime {
return o.info.LastModified
}
err := o.readMetaData()
if err != nil {
fs.Debugf(o, "Failed to read metadata: %s", err)