<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: filesListFolder slow in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/filesListFolder-slow/m-p/387105#M21502</link>
    <description>&lt;P&gt;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:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;You're using "limit: 5", which will limit&amp;nbsp;Dropbox to returning about 5 entries per page. Since you need to make an HTTP request and response for each page, using a small limit like that will increase the overhead and increase how long the entire process takes. If you don't need to use a small page size like that for some reason, switching to a larger number may speed this up.&lt;/LI&gt;
&lt;LI&gt;You're using "recursive: true", which can increase how much work&amp;nbsp;Dropbox has to do to list out the entries. If you don't need nested entries, switching this to "recursive: false" may speed this up.&lt;/LI&gt;
&lt;/UL&gt;</description>
    <pubDate>Thu, 02 Jan 2020 20:28:52 GMT</pubDate>
    <dc:creator>Greg-DB</dc:creator>
    <dc:date>2020-01-02T20:28:52Z</dc:date>
    <item>
      <title>filesListFolder slow</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/filesListFolder-slow/m-p/387088#M21500</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;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:&lt;/P&gt;
&lt;DIV&gt;
&lt;DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV&gt;
&lt;DIV&gt;
&lt;PRE&gt;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);&lt;/PRE&gt;
Thanks&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Fri, 03 Jan 2020 10:59:43 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/filesListFolder-slow/m-p/387088#M21500</guid>
      <dc:creator>filipengstrom91</dc:creator>
      <dc:date>2020-01-03T10:59:43Z</dc:date>
    </item>
    <item>
      <title>Re: filesListFolder slow</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/filesListFolder-slow/m-p/387105#M21502</link>
      <description>&lt;P&gt;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:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;You're using "limit: 5", which will limit&amp;nbsp;Dropbox to returning about 5 entries per page. Since you need to make an HTTP request and response for each page, using a small limit like that will increase the overhead and increase how long the entire process takes. If you don't need to use a small page size like that for some reason, switching to a larger number may speed this up.&lt;/LI&gt;
&lt;LI&gt;You're using "recursive: true", which can increase how much work&amp;nbsp;Dropbox has to do to list out the entries. If you don't need nested entries, switching this to "recursive: false" may speed this up.&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Thu, 02 Jan 2020 20:28:52 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/filesListFolder-slow/m-p/387105#M21502</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2020-01-02T20:28:52Z</dc:date>
    </item>
    <item>
      <title>Re: filesListFolder slow</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/filesListFolder-slow/m-p/387108#M21503</link>
      <description>&lt;P&gt;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!&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jan 2020 20:38:34 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/filesListFolder-slow/m-p/387108#M21503</guid>
      <dc:creator>filipengstrom91</dc:creator>
      <dc:date>2020-01-02T20:38:34Z</dc:date>
    </item>
  </channel>
</rss>

