bail out when services quit
This commit is contained in:
parent
334b6a2c55
commit
464b857a87
12
src/main.rs
12
src/main.rs
|
@ -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(())
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue