Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Daily Rotation sometimes happens twice #47

Closed
davesidwell opened this issue Jan 22, 2020 · 6 comments
Closed

Daily Rotation sometimes happens twice #47

davesidwell opened this issue Jan 22, 2020 · 6 comments

Comments

@davesidwell
Copy link

On certain target machines, when set for a daily rotation, the file will rotate 1 second prior to 0:00 UTC, and then again at 0:00 UTC
This would seem to occur on target machines with internal clocks that run slightly fast.
The rotation time is set using setTimeout with a 24 hour timer.
If due to the internal clock, this triggers slightly early the rotation takes place and is completed prior to 0:00 UTC, and the scheduler then calls setTimeout again to trigger at 0:00 UTC.

@iccicci
Copy link
Owner

iccicci commented Jan 23, 2020

Hi @davesidwell ,

can you provide me the name of rotated files in order to understand how many midnight(s) those machines have each day?

Thank you,
iCC

@davesidwell
Copy link
Author

davesidwell commented Jan 23, 2020 via email

@iccicci
Copy link
Owner

iccicci commented Jan 24, 2020

Hi @davesidwell ,

can I also see the piece of code initializing RotatingFileStream please?

Thank you,
iCC

@davesidwell
Copy link
Author

davesidwell commented Jan 24, 2020 via email

@davesidwell
Copy link
Author

davesidwell commented Jan 24, 2020 via email

@iccicci
Copy link
Owner

iccicci commented Jan 26, 2020

Hi @davesidwell ,

about the first problem I applied the patch you proposed: hope this helps.
About the second problem, I added a new test case to cover it: fixed as well.

I released v2.0.2,
iCC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants