Skip to content

Commit

Permalink
fix(build): add missing feature dependencies (#840)
Browse files Browse the repository at this point in the history
* Add missing feature dependencies

* Remove udeps

* Fix windows build
  • Loading branch information
Alex6323 authored Nov 2, 2022
1 parent 383cc40 commit 18d3b7e
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 12 deletions.
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ tokio = { version = "1.21", default-features = false, features = [ "macros", "rt
tokio-stream = { version = "0.1", default-features = false }
toml = { version = "0.5", default-features = false }
tracing = { version = "0.1", default-features = false, features = [ "std", "attributes" ] }
tracing-futures = { version = "0.2", default-features = false, features = [ "std", "std-future" ] }
tracing-subscriber = { version = "0.3", default-features = false, features = [ "std", "fmt", "ansi", "smallvec", "tracing-log", "local-time", "env-filter" ] }
uint = { version = "0.9", default-features = false }
url = { version = "2.3", default-features = false }
Expand Down Expand Up @@ -117,6 +116,7 @@ inx = [
"dep:inx",
"dep:packable",
"dep:tonic",
"stardust",
]
opentelemetry = [
"dep:opentelemetry",
Expand All @@ -128,6 +128,7 @@ rand = [
]
stardust = [
"dep:iota-types",
"dep:packable",
]

[profile.production]
Expand Down
30 changes: 20 additions & 10 deletions src/bin/inx-chronicle/process.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,28 @@
// Copyright 2022 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

use tokio::signal::unix::{signal, SignalKind};

pub async fn interrupt_or_terminate() {
let mut sigterm = signal(SignalKind::terminate()).expect("cannot listen to `SIGTERM`");
let mut sigint = signal(SignalKind::interrupt()).expect("cannot listen to `SIGINT`");
#[cfg(unix)]
{
use tokio::signal::unix::{signal, SignalKind};

tokio::select! {
_ = sigterm.recv() => {
tracing::info!("received `SIGTERM`, sending shutdown signal")
}
_ = sigint.recv() => {
tracing::info!("received `SIGTERM`, sending shutdown signal")
let mut sigterm = signal(SignalKind::terminate()).expect("cannot listen to `SIGTERM`");
let mut sigint = signal(SignalKind::interrupt()).expect("cannot listen to `SIGINT`");

tokio::select! {
_ = sigterm.recv() => {
tracing::info!("received `SIGTERM`, sending shutdown signal")
}
_ = sigint.recv() => {
tracing::info!("received `SIGINT`, sending shutdown signal")
}
}
}
#[cfg(not(unix))]
{
use tokio::signal::ctrl_c;

ctrl_c().await.expect("cannot listen to `CTRL-C`");
tracing::info!("received `CTRL-C`, sending shutdown signal")
}
}

0 comments on commit 18d3b7e

Please sign in to comment.