mirror of
https://github.com/teloxide/teloxide.git
synced 2025-03-14 11:44:04 +01:00
Fix overflow in dispatch_with_listener
This commit is contained in:
parent
f58ae9b9ca
commit
8785b8263c
1 changed files with 6 additions and 2 deletions
|
@ -287,8 +287,12 @@ where
|
|||
// FIXME: replace this by just Duration::ZERO once 1.53 will be released
|
||||
const DZERO: Duration = Duration::from_secs(0);
|
||||
|
||||
let shutdown_check_timeout =
|
||||
update_listener.timeout_hint().unwrap_or(DZERO) + MIN_SHUTDOWN_CHECK_TIMEOUT;
|
||||
let shutdown_check_timeout = update_listener.timeout_hint().unwrap_or(DZERO);
|
||||
|
||||
// FIXME: replace this by just saturating_add once 1.53 will be released
|
||||
let shutdown_check_timeout = shutdown_check_timeout
|
||||
.checked_add(MIN_SHUTDOWN_CHECK_TIMEOUT)
|
||||
.unwrap_or(shutdown_check_timeout);
|
||||
|
||||
let mut stop_token = Some(update_listener.stop_token());
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue