jottacloud: fix token refresh failed: is not a regular file error

Before this change the jottacloud token renewer would run and give the
error:

    Token refresh failed: is not a regular file

This is because the refresh runs on the root and it isn't a file.

This was fixed by ignoring that specific error.

See: https://forum.rclone.org/t/jottacloud-crypt-3-gb-copy-runs-for-a-week-without-completing/21173
This commit is contained in:
Nick Craig-Wood 2021-01-12 17:09:44 +00:00
parent 1936847548
commit c3dfa7d9a3
1 changed files with 3 additions and 0 deletions

View File

@ -730,6 +730,9 @@ func NewFs(name, root string, m configmap.Mapper) (fs.Fs, error) {
// Renew the token in the background
f.tokenRenewer = oauthutil.NewRenew(f.String(), ts, func() error {
_, err := f.readMetaDataForPath(ctx, "")
if err == fs.ErrorNotAFile {
err = nil
}
return err
})