Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion tokio/src/time/interval.rs
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,12 @@ impl Interval {
// However, if a tick took excessively long and we are now behind,
// schedule the next tick according to how the user specified with
// `MissedTickBehavior`
let next = if now > timeout + Duration::from_millis(5) {

let next = if now
> timeout
.checked_add(Duration::from_millis(5))
.unwrap_or_else(Instant::far_future)
{
self.missed_tick_behavior
.next_timeout(timeout, now, self.period)
} else {
Expand Down