bail out when services quit

This commit is contained in:
aniketfuryrocks 2023-01-31 22:32:50 +05:30
parent 334b6a2c55
commit 464b857a87
1 changed files with 6 additions and 6 deletions

View File

@ -1,6 +1,6 @@
use std::time::Duration;
use anyhow::Context;
use anyhow::bail;
use clap::Parser;
use lite_rpc::{bridge::LiteBridge, cli::Args};
@ -41,11 +41,11 @@ pub async fn main() -> anyhow::Result<()> {
let ctrl_c_signal = tokio::signal::ctrl_c();
tokio::select! {
services = services => {
services.context("Some services exited unexpectedly")?;
_ = services => {
bail!("Serives quit unexpectedly");
}
_ = ctrl_c_signal => {
Ok(())
}
_ = ctrl_c_signal => {}
}
Ok(())
}