Update
This commit is contained in:
1 parent
09fdf59394
commit
7bee2b4335
1 file changed
+2
-4
@@ -187,11 +187,9 @@ const processLogLine = async (line, test = false) => {
|
|||||||
log('The file has been truncated, and the offset has been reset');
|
log('The file has been truncated, and the offset has been reset');
|
||||||
}
|
}
|
||||||
|
|
||||||
fs.createReadStream(path, { start: fileOffset, encoding: 'utf8' })
|
fs.createReadStream(path, { start: fileOffset, encoding: 'utf8' }).on('data', chunk => {
|
||||||
.on('data', chunk => {
|
|
||||||
chunk.split('\n').filter(line => line.trim()).forEach(processLogLine);
|
chunk.split('\n').filter(line => line.trim()).forEach(processLogLine);
|
||||||
})
|
}).on('end', () => {
|
||||||
.on('end', () => {
|
|
||||||
fileOffset = stats.size;
|
fileOffset = stats.size;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in new issue
Block a user