File getting truncated with 'beginAt' set to 'end' not always detected
Opened this issue · 1 comments
user58823 commented
When the 'beginAt' option is set to 'end', before the file grows for the first time, no matter how much that file gets truncated, it will not be detected and all new data is completely skipped until the file grows beyond its original size again.
As far as I can tell, you need to add this.lastSize = stat.size;
somewhere inside this if-block:
Line 222 in d460a2b
Juul commented
I would gladly accept a pull request but I don't have time to troubleshoot
this myself right now :)
…On Tue, Apr 20, 2021 at 12:10 PM user58823 ***@***.***> wrote:
When the 'beginAt' option is set to 'end', before the file grows for the
first time, no matter how much that file gets truncated, it will not be
detected and all new data is completely skipped until the file grows beyond
its original size again.
As far as I can tell, you need to add this.lastSize = stat.size;
somewhere inside this if-block:
https://github.com/Juul/tail-stream/blob/d460a2b46d76325780ab6199b706964a38dace93/index.js#L222
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#26>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAA57AHIKBYK4WFYZDX4FCDTJXGTHANCNFSM43I3GTCA>
.