added more graceful interrupt handler

fuck_this_bullshit
Avril 4 years ago
parent 4124aa7d07
commit 9c8707fc44
Signed by: flanchan
GPG Key ID: 284488987C31F630

@ -47,7 +47,12 @@ async fn main() -> eyre::Result<()> {
.wrap_err(eyre!("Invalid config")) .wrap_err(eyre!("Invalid config"))
.with_suggestion(|| "Try running `--help`")?); .with_suggestion(|| "Try running `--help`")?);
let graph = work::work_on_all(state).await; let graph = tokio::select!{
x = work::work_on_all(state) => {x}
_ = tokio::signal::ctrl_c() => {
return Err(eyre!("Interrupt signalled, exiting"));
}
};
let mut graph = graph.into_hierarchical(); let mut graph = graph.into_hierarchical();
graph.compute_recursive_sizes(); graph.compute_recursive_sizes();

Loading…
Cancel
Save