quatrix: fix incorrect modtime after uploading a file
Update (which Put also uses) kept the caller's full precision modtime in memory while the upload finalize request sends it rounded to microseconds, so until the object was re-read the modtime did not match what a fresh listing would report. This broke wrappers which compare exact modtimes, such as the hasher backend's fingerprint and the VFS cache. Round the modtime to microseconds to match what the server stores.
This commit is contained in:
@@ -1151,7 +1151,10 @@ func (o *Object) dynamicUpload(ctx context.Context, size int64, modTime time.Tim
|
||||
}
|
||||
|
||||
o.size = size
|
||||
o.modTime = modTime
|
||||
// finalize sends the modtime rounded to microseconds so round
|
||||
// here too to keep the in-memory modtime identical to the one a
|
||||
// fresh listing returns.
|
||||
o.modTime = modTime.Round(time.Microsecond)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user