Skip to content

Commit 4cc4dba

Browse files
committed
fix exit process
1 parent ed557ad commit 4cc4dba

File tree

1 file changed

+2
-29
lines changed

1 file changed

+2
-29
lines changed

server/src/main.rs

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -175,35 +175,8 @@ async fn main() -> Result<()> {
175175
})
176176
.await?;
177177

178-
#[cfg(unix)]
179-
{
180-
use tokio::signal::unix;
181-
let mut terminate = unix::signal(unix::SignalKind::interrupt())?;
182-
tokio::select! {
183-
Err(e) = handler.start_modules() => {
184-
error!("Error running modules: {:?}", e);
185-
}
186-
_ = tokio::signal::ctrl_c() => {
187-
info!("Ctrl-C received, shutting down");
188-
}
189-
_ = terminate.recv() => {
190-
info!("SIGTERM received, shutting down");
191-
}
192-
}
193-
_ = handler.shutdown_modules().await;
194-
}
195-
#[cfg(not(unix))]
196-
{
197-
tokio::select! {
198-
Err(e) = handler.start_modules() => {
199-
error!("Error running modules: {:?}", e);
200-
}
201-
_ = tokio::signal::ctrl_c() => {
202-
info!("Ctrl-C received, shutting down");
203-
}
204-
}
205-
_ = handler.shutdown_modules().await;
206-
}
178+
handler.start_modules().await?;
179+
handler.exit_process().await?;
207180

208181
Ok(())
209182
}

0 commit comments

Comments
 (0)