forked from TrueCloudLab/rclone
local: report error on stat in Hash in case file disappeared
This commit is contained in:
parent
ce04a073ef
commit
d0678bc3e5
1 changed files with 6 additions and 1 deletions
|
@ -444,7 +444,12 @@ func (o *Object) Hash(r fs.HashType) (string, error) {
|
||||||
// Check that the underlying file hasn't changed
|
// Check that the underlying file hasn't changed
|
||||||
oldtime := o.info.ModTime()
|
oldtime := o.info.ModTime()
|
||||||
oldsize := o.info.Size()
|
oldsize := o.info.Size()
|
||||||
_ = o.lstat()
|
err := o.lstat()
|
||||||
|
if err != nil {
|
||||||
|
fs.Stats.Error()
|
||||||
|
fs.ErrorLog(o, "Failed to stat: %s", err)
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
|
||||||
if !o.info.ModTime().Equal(oldtime) || oldsize != o.info.Size() {
|
if !o.info.ModTime().Equal(oldtime) || oldsize != o.info.Size() {
|
||||||
o.hashes = nil
|
o.hashes = nil
|
||||||
|
|
Loading…
Add table
Reference in a new issue