Skip to content

Commit

Permalink
fix panic in get_worker
Browse files Browse the repository at this point in the history
  • Loading branch information
tmcgroul committed Aug 25, 2024
1 parent 604bb8b commit 453b20b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions crates/router-controller/src/controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,10 @@ impl Controller {
if info.suspended {
return None
}
if now.duration_since(info.last_ping).unwrap() > Duration::from_secs(30) {
return None
if let Ok(duration) = now.duration_since(info.last_ping) {
if duration > Duration::from_secs(30) {
return None
}
}
if info.state.get(dataset).map_or(false, |ranges| ranges.has(first_block)) {
Some(info)
Expand Down

0 comments on commit 453b20b

Please sign in to comment.