-
Notifications
You must be signed in to change notification settings - Fork 94
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
fix timestamp warnings #791
Conversation
@@ -70,7 +70,7 @@ impl Ping { | |||
} | |||
}; | |||
|
|||
let recv_time = chrono::Utc::now().timestamp_nanos(); | |||
let recv_time = chrono::Utc::now().timestamp_nanos_opt().unwrap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any risk of timestamp_nanos_opt()
returning None
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only if people are still running Quilkin in a couple hundred years. https://docs.rs/chrono/latest/chrono/struct.DateTime.html#method.timestamp_nanos_opt
An i64 with nanosecond precision can span a range of ~584 years. This function panics on an out of range DateTime.
The dates that can be represented as nanoseconds are between 1677-09-21T00:12:44.0 and 2262-04-11T23:47:16.854775804.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can only hope 😃
Build Succeeded 🥳 Build Id: 290c3a92-4c46-47ac-8e44-5d63389b9957 The following development images have been built, and will exist for the next 30 days: To build this version:
|
This is preventing all other PRs from succeeding.