Skip to content

Commit

Permalink
remove future after it has failed
Browse files Browse the repository at this point in the history
  • Loading branch information
yu-re-ka committed Nov 22, 2023
1 parent d92d338 commit e61d20e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,10 @@ async fn main() -> anyhow::Result<()> {
info!("shutting down on signal SIGTERM");
Ok(())
}
task_ended = select_all(&mut futures) => {
(result, idx, _) = select_all(&mut futures) => {
warn!("shutting down because task unexpectedly ended");
task_ended.0?
futures.remove(idx);
result?
}
};
shutdown_tx.send(true)?;
Expand Down

0 comments on commit e61d20e

Please sign in to comment.