You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 2, 2019. It is now read-only.
Processing files with millions of records result in a crash on maximum call stack exceeded.
I believe returning queueData recursively just adds to the function stack. Deferring the recursive call to the next tick avoids this issue.
` function queueData (data, number) {
...
// If the next value is in the queue, write it
if (writeQueue.hasOwnProperty(nextToWrite)) {
var dataToWrite = writeQueue[nextToWrite]
delete writeQueue[nextToWrite]
process.nextTick(() => {
return queueData(dataToWrite, nextToWrite);
});
}
...
}`
The text was updated successfully, but these errors were encountered:
Processing files with millions of records result in a crash on maximum call stack exceeded.
I believe returning queueData recursively just adds to the function stack. Deferring the recursive call to the next tick avoids this issue.
` function queueData (data, number) {
...
// If the next value is in the queue, write it
if (writeQueue.hasOwnProperty(nextToWrite)) {
var dataToWrite = writeQueue[nextToWrite]
delete writeQueue[nextToWrite]
process.nextTick(() => {
return queueData(dataToWrite, nextToWrite);
});
}
...
}`
The text was updated successfully, but these errors were encountered: