Skip to content

Commit

Permalink
Bugfix/Standalone: Removed dependency to unix shutdown signals
Browse files Browse the repository at this point in the history
  • Loading branch information
alexliesenfeld committed Mar 22, 2021
1 parent 427169d commit ebf7b1f
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/server/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ use futures_util::task::Spawn;
use std::future::Future;
use std::iter::Map;
use std::time::Instant;
use tokio::signal::unix::SignalKind;

mod matchers;

Expand Down Expand Up @@ -407,12 +406,14 @@ async fn handle_server_request(

#[cfg(not(target_os = "windows"))]
async fn shutdown_signal() {
let mut hangup_stream = tokio::signal::unix::signal(SignalKind::hangup())
.expect("Cannot install SIGINT signal handler");
let mut sigint_stream = tokio::signal::unix::signal(SignalKind::interrupt())
.expect("Cannot install SIGINT signal handler");
let mut sigterm_stream = tokio::signal::unix::signal(SignalKind::terminate())
let mut hangup_stream = tokio::signal::unix::signal(tokio::signal::unix::SignalKind::hangup())
.expect("Cannot install SIGINT signal handler");
let mut sigint_stream =
tokio::signal::unix::signal(tokio::signal::unix::SignalKind::interrupt())
.expect("Cannot install SIGINT signal handler");
let mut sigterm_stream =
tokio::signal::unix::signal(tokio::signal::unix::SignalKind::terminate())
.expect("Cannot install SIGINT signal handler");

tokio::select! {
val = hangup_stream.recv() => log::trace!("Received SIGINT"),
Expand Down

0 comments on commit ebf7b1f

Please sign in to comment.