mirror of
https://github.com/rclone/rclone.git
synced 2024-11-22 08:23:47 +01:00
vfs: fix incorrect modtime on fs which don't support setting modtime
Before this change we were using the Precision literally to round the precision of the mod times. However fs.ModTimeNotSupported is 100y on backends which don't support setting modtimes so rounding to 100y was producing very strange results. See: https://forum.rclone.org/t/saving-files-causes-wrong-modified-time-to-be-set-for-a-few-seconds-on-webdav-mount-with-bitrix24/36451/
This commit is contained in:
parent
19e8c8d42a
commit
143285e2b7
@ -296,6 +296,9 @@ func (f *File) activeWriters() int {
|
||||
// It should be called with the lock held
|
||||
func (f *File) _roundModTime(modTime time.Time) time.Time {
|
||||
precision := f.d.f.Precision()
|
||||
if precision == fs.ModTimeNotSupported {
|
||||
return modTime
|
||||
}
|
||||
return modTime.Truncate(precision)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user