node-stream-transform
node-stream-transform copied to clipboard
Transform stream does not read all the records .
I am transform stream
It suddenly stops printing the record at around record number 478 .
Finish or end event is also not triggered nothing happens this is very weird!!!
let updateRecordsWithStatus = transform(async (record, callback) => {
console.log('rec'+ JSON.stringify(record))
record.ENTITY_OPERATION_STATUS = 'SUCCESS';
errorMap = await this.getBatchErrorMap(batch);
recordCount++;
callback(null, record);
}, {
parallel: 0
});
inputFileStream.pipe(csvParser).pipe(updateRecordsWithStatus).pipe(outputFileStream);
Your have an await statement inside a function expecting a callback, this is not right. Note, I am not sure this cause any problem.