I have a situation where I am iterating over a directory of files in Firefox with something like the following:
let iterator = OS.File.DirectoryIterator(dir);
let itPromise = iterator.forEach(entry){
return OS.File.read(entry.path).then(array => {
return anotherPromise(array).then (
.
.
.
}
});
return itPromise.then( function () {
//DO stuff after iterator is completely done
});
It seems like this iterator promise sometimes times out and never makes it to the //Do stuff after iterator line. If I am doing this for a small number of files, it seems to work fine - but if my iterator seems to take more than say, a minute (or some unknown magic number), the promise never returns. Is firefox doing something to shut down my OS.File iterator?
I read in a bug report here: https://bugzilla.mozilla.org/show_bug.cgi?id=1279389
that there is a osfile.reset_worker_delay preference, but I don't seem to be able to find that in Firefox 47, or any of the developer versions I downloaded.
Is that what is causing my problem - the iterator takes too long, and thus firefox wont skip to the next part?