Skip to content

Commit

Permalink
Listen to exit signal
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnyasantoss committed Jun 30, 2024
1 parent 29c9acc commit 6951279
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions roles/mining-proxy/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ mod lib;
use lib::Config;
use roles_logic_sv2::utils::{GroupId, Mutex};
use std::{net::SocketAddr, sync::Arc};
use tracing::{error, info};
use tracing::{error, info, warn};

mod args {
use std::path::PathBuf;
Expand Down Expand Up @@ -137,5 +137,9 @@ async fn main() {
);

info!("PROXY INITIALIZED");
crate::lib::downstream_mining::listen_for_downstream_mining(socket).await

tokio::select! {
_ = lib::downstream_mining::listen_for_downstream_mining(socket) => warn!("Downstream mining exited"),
_ = tokio::signal::ctrl_c() => info!("Interrupt received"),
}
}

0 comments on commit 6951279

Please sign in to comment.