fix: unexpected error due to channel closing

This commit is contained in:
sxyazi 2023-09-18 06:55:50 +08:00
parent 9bf4f70b3a
commit a5949c5cb5
No known key found for this signature in database

View file

@ -48,7 +48,7 @@ impl Event {
pub async fn wait<T>(self, rx: oneshot::Receiver<T>) -> T {
TX.send(self).ok();
rx.await.unwrap()
rx.await.unwrap_or_else(|_| std::process::exit(0))
}
}