diff --git a/agent/src/smart_agent.rs b/agent/src/smart_agent.rs index 0c07730..6d90c2f 100644 --- a/agent/src/smart_agent.rs +++ b/agent/src/smart_agent.rs @@ -120,9 +120,6 @@ impl SmartAgent { _ = stats_interval.tick() => { self.log_metric_stats().await; } - _ = self.handle_commands() => { - // Commands handled in background - } } } } @@ -282,42 +279,10 @@ impl SmartAgent { } - /// Handle incoming commands from dashboard (non-blocking) - async fn handle_commands(&mut self) { - // Check for commands with non-blocking receive - match self.zmq_command_socket.recv_string(zmq::DONTWAIT) { - Ok(Ok(command)) => { - info!("Received command: {}", command); - match command.as_str() { - "refresh" => { - info!("Processing refresh command - forcing immediate collection"); - self.force_refresh_all().await; - - // Send response - let response = "refresh_started"; - if let Err(e) = self.zmq_command_socket.send(response, 0) { - warn!("Failed to send command response: {}", e); - } - } - _ => { - warn!("Unknown command: {}", command); - let response = "unknown_command"; - if let Err(e) = self.zmq_command_socket.send(response, 0) { - warn!("Failed to send error response: {}", e); - } - } - } - } - Ok(Err(e)) => { - warn!("String conversion error: {:?}", e); - } - Err(zmq::Error::EAGAIN) => { - // No message available - this is normal - } - Err(e) => { - warn!("ZMQ command receive error: {}", e); - } - } + /// Handle incoming commands from dashboard (temporarily disabled) + async fn _handle_commands(&mut self) { + // TODO: Re-implement command handling properly + // This function was causing ZMQ state errors when called continuously } /// Force immediate collection of all metrics