Fixes
This commit is contained in:
parent
e4c43b8b0c
commit
47c0879b86
1 changed files with 1 additions and 1 deletions
2
index.js
2
index.js
|
|
@ -121,8 +121,8 @@ const processLogLine = async line => {
|
||||||
.on('change', path => {
|
.on('change', path => {
|
||||||
const stats = fs.statSync(path);
|
const stats = fs.statSync(path);
|
||||||
if (stats.size < fileOffset) {
|
if (stats.size < fileOffset) {
|
||||||
log(1, 'File truncated. Resetting offset...');
|
|
||||||
fileOffset = 0;
|
fileOffset = 0;
|
||||||
|
log(1, 'The file has been truncated, and the offset has been reset.');
|
||||||
}
|
}
|
||||||
|
|
||||||
fs.createReadStream(path, { start: fileOffset, encoding: 'utf8' }).on('data', chunk => {
|
fs.createReadStream(path, { start: fileOffset, encoding: 'utf8' }).on('data', chunk => {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue