forked from TrueCloudLab/rclone
azureblob: implement --use-server-modtime
This patch implements --use-server-modtime for the Azureblob backend. It does this by not reading the time from the metadata if the global flag is set.
This commit is contained in:
parent
6f8112ff67
commit
7be9855a70
2 changed files with 10 additions and 2 deletions
|
@ -1590,7 +1590,9 @@ func (o *Object) setMetadata(metadata map[string]string) {
|
||||||
for k, v := range metadata {
|
for k, v := range metadata {
|
||||||
o.meta[strings.ToLower(k)] = v
|
o.meta[strings.ToLower(k)] = v
|
||||||
}
|
}
|
||||||
if modTime, ok := o.meta[modTimeKey]; ok {
|
// Set o.modTime from metadata if it exists and
|
||||||
|
// UseServerModTime isn't in use.
|
||||||
|
if modTime, ok := o.meta[modTimeKey]; !o.fs.ci.UseServerModTime && ok {
|
||||||
when, err := time.Parse(timeFormatIn, modTime)
|
when, err := time.Parse(timeFormatIn, modTime)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fs.Debugf(o, "Couldn't parse %v = %q: %v", modTimeKey, modTime, err)
|
fs.Debugf(o, "Couldn't parse %v = %q: %v", modTimeKey, modTime, err)
|
||||||
|
|
|
@ -80,7 +80,13 @@ docs](/docs/#fast-list) for more details.
|
||||||
The modified time is stored as metadata on the object with the `mtime`
|
The modified time is stored as metadata on the object with the `mtime`
|
||||||
key. It is stored using RFC3339 Format time with nanosecond
|
key. It is stored using RFC3339 Format time with nanosecond
|
||||||
precision. The metadata is supplied during directory listings so
|
precision. The metadata is supplied during directory listings so
|
||||||
there is no overhead to using it.
|
there is no performance overhead to using it.
|
||||||
|
|
||||||
|
If you wish to use the Azure standard `LastModified` time stored on
|
||||||
|
the object as the modified time, then use the `--use-server-modtime`
|
||||||
|
flag. Note that rclone can't set `LastModified`, so using the
|
||||||
|
`--update` flag when syncing is recommended if using
|
||||||
|
`--use-server-modtime`.
|
||||||
|
|
||||||
### Performance
|
### Performance
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue