-
Notifications
You must be signed in to change notification settings - Fork 0
Optimize dependencies #148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,7 +12,6 @@ use transport::{connect_mqtt, Topic}; | |
| use futures_util::StreamExt; | ||
| use log::{error, info, trace}; | ||
| use paho_mqtt::{AsyncClient as MqClient, MessageBuilder, QOS_1}; | ||
| use tokio::signal::unix::{signal, SignalKind}; | ||
| use tokio::{task, time}; | ||
|
|
||
| const VERSION: &str = env!("CARGO_PKG_VERSION"); | ||
|
|
@@ -43,13 +42,7 @@ async fn main() -> Result<()> { | |
| let set_handle = task::spawn(subscribe_action(mqtt_client.clone(), client.clone())); | ||
| let state_handle = task::spawn(subscribe_state(mqtt_client, storage, client)); | ||
|
|
||
| tokio::select! { | ||
| _ = try_join(set_handle, state_handle) => {}, | ||
| _ = tokio::spawn(async move { | ||
| let mut sig = signal(SignalKind::terminate()).unwrap(); | ||
| sig.recv().await | ||
| }) => { info!("got SIGTERM, exiting...") }, | ||
| }; | ||
| try_join(set_handle, state_handle).await?; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The graceful shutdown logic has been removed. As |
||
|
|
||
| Ok(()) | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,7 +7,7 @@ edition = "2021" | |
| log = "0.4" | ||
|
|
||
| tokio-tungstenite = { version = "0.26.2", features = ["native-tls"] } | ||
| tokio = { version = "1", features = ["fs", "net", "sync"] } | ||
| tokio = { version = "1", features = ["fs", "io-util", "net", "sync"] } | ||
| futures-util = "0.3" | ||
|
|
||
| chipp_http = "1.2" | ||
|
|
@@ -22,4 +22,4 @@ serde_json = "1.0" | |
| chrono = { version = "0.4", features = ["std", "clock"], default-features = false } | ||
| chrono-humanize = "0.2" | ||
|
|
||
| zip = { version = "2.6", default-features = false, features = ["deflate"] } | ||
| zip = { version = "3.0", default-features = false, features = ["deflate"] } | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing the
signalfeature fromtokiois problematic as it breaks the graceful shutdown functionality insrc/main.rs. Please re-add thesignalfeature. It's also advisable to keep thenetandsyncfeatures for a networked, multi-threaded application like this to avoid potential issues.