Open braco opened 6 years ago
Removing objectMode from csv() and parsing the json further down seems to work:
reader
.pipe(csv({},{flatKeys:true}))
.pipe(through2Concurrent.obj(
{maxConcurrency},
function (chunk, enc, callback) {
let self = this;
const _chunk = JSON.parse(chunk.toString());
lineFunction(_chunk).then(results => { self.push(results); callback() })
}
))
In the line of the source code if it is changed to:
return Buffer.concat([runtime.csvLineBuffer, Buffer.from(chunk)]);
it also gets fixed
Getting this error:
From this line in
concatLeftChunk()
concatLeftChunk() is trying to pass this in:
My setup is roughly like this:
It runs for a while, seemingly correct, and then errors.
Using this as shown above https://www.npmjs.com/package/through2-concurrent