This fixes the polling implementation for Dropbox, particularly when using a scoped app. This also adds a lower end check for the timeout, as I forgot to include that in the original implementation.
This commit is contained in:
parent
f7e3115955
commit
c3e2392f2b
1 changed files with 16 additions and 1 deletions
|
@ -1255,7 +1255,17 @@ func (f *Fs) changeNotifyCursor() (cursor string, err error) {
|
|||
var startCursor *files.ListFolderGetLatestCursorResult
|
||||
|
||||
err = f.pacer.Call(func() (bool, error) {
|
||||
startCursor, err = f.srv.ListFolderGetLatestCursor(&files.ListFolderArg{Path: f.opt.Enc.FromStandardPath(f.slashRoot), Recursive: true})
|
||||
arg := files.ListFolderArg{
|
||||
Path: f.opt.Enc.FromStandardPath(f.slashRoot),
|
||||
Recursive: true,
|
||||
}
|
||||
|
||||
if arg.Path == "/" {
|
||||
arg.Path = ""
|
||||
}
|
||||
|
||||
startCursor, err = f.srv.ListFolderGetLatestCursor(&arg)
|
||||
|
||||
return shouldRetry(err)
|
||||
})
|
||||
if err != nil {
|
||||
|
@ -1270,6 +1280,11 @@ func (f *Fs) changeNotifyRunner(ctx context.Context, notifyFunc func(string, fs.
|
|||
|
||||
// Dropbox sets a timeout range of 30 - 480
|
||||
timeout := uint64(f.ci.TimeoutOrInfinite() / time.Second)
|
||||
|
||||
if timeout < 30 {
|
||||
timeout = 30
|
||||
}
|
||||
|
||||
if timeout > 480 {
|
||||
timeout = 480
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue