<div dir="ltr">I have posted this on stackoverflow here:  <a href="http://stackoverflow.com/questions/39839752/os-file-directoryiterator-timeout-in-firefox-addon">http://stackoverflow.com/questions/39839752/os-file-directoryiterator-timeout-in-firefox-addon</a><div><br></div><div>The gist of the problem is that when I have a lot of files in the directory, of which I am returning a OS.File.read and some other asynchronous operations, I am noticing that with a high number of files, the promise returned by forEach never resolves and goes to the "then()" block after the code has run. </div><div><br></div><div>Does DirectoryIterator have a timeout, and if so, what is a way I can get around this problem?</div></div>