Skip to content
New issue

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

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

Already on GitHub? # to your account

LOG_ERROR_PERIODICALLY() would not log in the first hour after system boot. #626

Merged
merged 1 commit into from
May 10, 2023

Conversation

kentonv
Copy link
Member

@kentonv kentonv commented May 9, 2023

Since it uses the monotonic clock, the "origin" time is system boot time. So the first time LOG_ERROR_PERIODICALLY() runs, it thinks it last logged at system boot time, and it only logs again if it's been more than an hour since then.

We'll just subtract an hour from the origin. Monotonic time is never negative so this should be sufficient.

… boot.

Since it uses the monotonic clock, the "origin" time is system boot time. So the first time LOG_ERROR_PERIODICALLY() runs, it thinks it last logged at system boot time, and it only logs again if it's been more than an hour since then.

We'll just subtract an hour from the origin. Monotonic time is never negative so this should be sufficient.
@kentonv kentonv force-pushed the kenton/fix-log-error-periodic branch from 3f39259 to 226742b Compare May 9, 2023 22:50
@kentonv kentonv merged commit aa7505b into main May 10, 2023
@kentonv kentonv deleted the kenton/fix-log-error-periodic branch May 10, 2023 00:13
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants