You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When used in conjunction with continuous truncation (>) as opposed to appending (>>) only reacts to the first event, ignore all following ones. Simple test case:
$ while true; do echo "$(date)" > watched.log; sleep 1; done
It will truncate file every second before writing a single line into it.
Expected behaviour
The code correctly detects the truncation events and re-opens the file accordingly. So the output would look something like this:
Mon Dec 18 04:23:44 PM UTC 2023
2023/12/18 16:23:45 Re-opening truncated file watched.log ...
2023/12/18 16:23:45 Successfully reopened truncated watched.log
Mon Dec 18 04:23:45 PM UTC 2023
2023/12/18 16:23:46 Re-opening truncated file watched.log ...
2023/12/18 16:23:46 Successfully reopened truncated watched.log
Mon Dec 18 04:23:46 PM UTC 2023
...
Actual behaviour
It detects first event, and reads a single line after that ignoring everything else:
2023/12/18 16:31:45 Waiting for watched.log to appear...
Mon Dec 18 04:31:48 PM UTC 2023
To Reproduce
See steps above. I've tried with Poll:true to no avail.
System information
1.4.11
Fedora 37
amd64
Additional context
The text was updated successfully, but these errors were encountered:
Describe the bug
Simple code:
When used in conjunction with continuous truncation (
>
) as opposed to appending (>>
) only reacts to the first event, ignore all following ones. Simple test case:It will truncate file every second before writing a single line into it.
Expected behaviour
The code correctly detects the truncation events and re-opens the file accordingly. So the output would look something like this:
Actual behaviour
It detects first event, and reads a single line after that ignoring everything else:
To Reproduce
See steps above. I've tried with
Poll:true
to no avail.System information
Additional context
The text was updated successfully, but these errors were encountered: