diff --git a/tfclient/src/daemon.rs b/tfclient/src/daemon.rs index 72cf9f7..eed639c 100644 --- a/tfclient/src/daemon.rs +++ b/tfclient/src/daemon.rs @@ -6,7 +6,7 @@ use std::thread; use crate::apiworker::{apiworker_main, APIWorkerMessage}; use crate::config::load_config; -use crate::nebulaworker::NebulaWorkerMessage; +use crate::nebulaworker::{NebulaWorkerMessage, nebulaworker_main}; use crate::socketworker::{socketworker_main, SocketWorkerMessage}; use crate::timerworker::{timer_main, TimerWorkerMessage}; use crate::util::check_server_url; @@ -28,7 +28,7 @@ pub fn daemon_main(name: String, server: String) { let (tx_api, rx_api) = mpsc::channel::(); let (tx_socket, rx_socket) = mpsc::channel::(); - let (tx_nebula, _rx_nebula) = mpsc::channel::(); + let (tx_nebula, rx_nebula) = mpsc::channel::(); let (tx_timer, rx_timer) = mpsc::channel::(); let transmitter = ThreadMessageSender { @@ -108,12 +108,12 @@ pub fn daemon_main(name: String, server: String) { }); info!("Starting Nebula thread..."); - let _config_nebula = config.clone(); - let _transmitter_nebula = transmitter.clone(); - let _name_nebula = name.clone(); - //let nebula_thread = thread::spawn(move || { - // nebulaworker_main(config_nebula, name_nebula, transmitter_nebula, rx_nebula); - //}); + let config_nebula = config.clone(); + let transmitter_nebula = transmitter.clone(); + let name_nebula = name.clone(); + let nebula_thread = thread::spawn(move || { + nebulaworker_main(config_nebula, name_nebula, transmitter_nebula, rx_nebula); + }); info!("Starting socket worker thread..."); let name_socket = name; @@ -163,13 +163,13 @@ pub fn daemon_main(name: String, server: String) { info!("API thread exited"); info!("Waiting for Nebula thread to exit..."); - //match nebula_thread.join() { - // Ok(_) => (), - // Err(_) => { - // error!("Error waiting for nebula thread to exit."); - // std::process::exit(1); - // } - //} + match nebula_thread.join() { + Ok(_) => (), + Err(_) => { + error!("Error waiting for nebula thread to exit."); + std::process::exit(1); + } + } info!("Nebula thread exited"); info!("All threads exited");