node-stream-transform icon indicating copy to clipboard operation
node-stream-transform copied to clipboard

Transform stream does not read all the records .

Open swarnim1996 opened this issue 4 years ago • 1 comments

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);

swarnim1996 avatar Oct 02 '20 22:10 swarnim1996

Your have an await statement inside a function expecting a callback, this is not right. Note, I am not sure this cause any problem.

wdavidw avatar Oct 05 '20 06:10 wdavidw