Closed chantra closed 1 year ago
I had this issue happening live. The application would handle the rate limit error and go to sleep until it is ready to resume. In this case, it would have gone to sleep for some 584942417355 years :D
Make sense to me. This should be applied to #57 as well.
Make sense to me. This should be applied to #57 as well.
Thanks. Yes, I will rebase.
There is a change that
SystemTime::now()
is computed the second after the "reset" value, or simply clocks could also be slightly off.When running in "release" mode, this can lead to an overflow, with the value returned being wrapped to the high u64 values.
https://play.rust-lang.org/?version=stable&mode=release&edition=2021&gist=0c3610ae88babccc0c71ae6e18b07e60
This change ensures that we floor our result to 0 instead of wrapping to u64::MAX