acd, onedrive: fix initialization order for token renewer - fixes #1442
This commit is contained in:
parent
d7811f72ad
commit
70b5b2f5c6
2 changed files with 12 additions and 12 deletions
|
@ -192,6 +192,12 @@ func NewFs(name, root string) (fs.Fs, error) {
|
|||
}
|
||||
f.features = (&fs.Features{CaseInsensitive: true, ReadMimeType: true}).Fill(f)
|
||||
|
||||
// Renew the token in the background
|
||||
f.tokenRenewer = oauthutil.NewRenew(f.String(), ts, func() error {
|
||||
_, err := f.getRootInfo()
|
||||
return err
|
||||
})
|
||||
|
||||
// Update endpoints
|
||||
var resp *http.Response
|
||||
err = f.pacer.Call(func() (bool, error) {
|
||||
|
@ -209,12 +215,6 @@ func NewFs(name, root string) (fs.Fs, error) {
|
|||
}
|
||||
f.trueRootID = *rootInfo.Id
|
||||
|
||||
// Renew the token in the background
|
||||
f.tokenRenewer = oauthutil.NewRenew(f.String(), ts, func() error {
|
||||
_, err := f.getRootInfo()
|
||||
return err
|
||||
})
|
||||
|
||||
f.dirCache = dircache.New(root, f.trueRootID, f)
|
||||
|
||||
// Find the current root
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue