This commit is contained in:
sxyazi 2024-01-22 08:17:19 +08:00
parent d0a98b549d
commit cffd2ae409
No known key found for this signature in database

View file

@ -54,21 +54,19 @@ impl Signals {
let tx = self.tx.clone(); let tx = self.tx.clone();
Ok(tokio::spawn(async move { Ok(tokio::spawn(async move {
loop { while let Some(signal) = signals.next().await {
while let Some(signal) = signals.next().await { if BLOCKER.try_acquire().is_err() {
if BLOCKER.try_acquire().is_err() { continue;
continue; }
}
match signal { match signal {
SIGHUP | SIGTERM | SIGQUIT | SIGINT => { SIGHUP | SIGTERM | SIGQUIT | SIGINT => {
if tx.send(Event::Quit(Default::default())).is_err() { if tx.send(Event::Quit(Default::default())).is_err() {
break; break;
}
} }
SIGCONT => Scheduler::app_resume(),
_ => {}
} }
SIGCONT => Scheduler::app_resume(),
_ => {}
} }
} }
})) }))