Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
Hi,
I use the Dropbox webhook to start a Javascript function I've written. It worked great the first few months when the folders just contained a few files. Now they contain approximately 200-250 files and it takes approximately 30 seconds to fetch all the files with filesListFolder function. This amount of time surely can't be normal, I want to be able to use it as my folders grows with files. The following lines of code are where I figure the problem is:
const fetch = require('isomorphic-fetch'); // or another library of choice. const Dropbox = require("dropbox").Dropbox; const dbx = new Dropbox({ accessToken: 'T-BxAk********************************************Cn2eeFT', fetch: fetch }); const response = await dbx.filesListFolder({ path: "/Redovisning/", recursive: true, limit: 5 }) let cursor = response.cursor; let hasMore = response.has_more; const entriesArray = [response.entries]; while (hasMore === true) { let responseWhile = await dbx.filesListFolderContinue({ cursor: cursor }); hasMore = responseWhile.has_more; cursor = responseWhile.cursor; for (entry of responseWhile.entries) { entriesArray.push(entry); } } console.log(entriesArray);Thanks
There are a number of variables that can affect the overall performance here, so we can't promise any specific speed for listing a folder. Looking at your code though, there are a few things that may help:
There are a number of variables that can affect the overall performance here, so we can't promise any specific speed for listing a folder. Looking at your code though, there are a few things that may help:
Thank you for your reply. Changing the limit to 2000 solved my problem. It now loads within a couple of seconds. I realise that I didn't understand what limit meant. Thanks!
Hi there!
If you need more help you can view your support options (expected response time for a ticket is 24 hours), or contact us on X or Facebook.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!