From bce97ffe0b88607b470bd36c9281b00a8ab3763a Mon Sep 17 00:00:00 2001 From: c0repwn3r Date: Sun, 28 May 2023 16:13:35 -0400 Subject: [PATCH] hotfix! re-enable nebula thread on tfclient --- tfclient/src/daemon.rs | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) 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");