Dont exit early when running only scheduled tasks (fixes #4709)

This commit is contained in:
Felix Ableitner 2024-05-07 11:39:12 +02:00
parent b152be7951
commit 870a0043c4

View file

@ -218,17 +218,15 @@ pub async fn start_lemmy_server(args: CmdArgs) -> LemmyResult<()> {
let mut interrupt = tokio::signal::unix::signal(SignalKind::interrupt())?; let mut interrupt = tokio::signal::unix::signal(SignalKind::interrupt())?;
let mut terminate = tokio::signal::unix::signal(SignalKind::terminate())?; let mut terminate = tokio::signal::unix::signal(SignalKind::terminate())?;
if server.is_some() || federate.is_some() { tokio::select! {
tokio::select! { _ = tokio::signal::ctrl_c() => {
_ = tokio::signal::ctrl_c() => { tracing::warn!("Received ctrl-c, shutting down gracefully...");
tracing::warn!("Received ctrl-c, shutting down gracefully..."); }
} _ = interrupt.recv() => {
_ = interrupt.recv() => { tracing::warn!("Received interrupt, shutting down gracefully...");
tracing::warn!("Received interrupt, shutting down gracefully..."); }
} _ = terminate.recv() => {
_ = terminate.recv() => { tracing::warn!("Received terminate, shutting down gracefully...");
tracing::warn!("Received terminate, shutting down gracefully...");
}
} }
} }
if let Some(server) = server { if let Some(server) = server {