mirror of
				https://github.com/csehviktor/status-monitor.git
				synced 2025-08-08 18:06:14 +02:00 
			
		
		
		
	cleaup code
This commit is contained in:
		@@ -1,7 +1,7 @@
 | 
			
		||||
use common::{metrics::Metrics, mqtt::{StatusMessage, STATUS_TOPIC}};
 | 
			
		||||
use common::{metrics::Metrics, StatusMessage, MQTT_TOPIC};
 | 
			
		||||
use rumqttc::{AsyncClient, MqttOptions, QoS};
 | 
			
		||||
use std::time::Duration;
 | 
			
		||||
use tokio::task::JoinHandle;
 | 
			
		||||
use std::time::Duration;
 | 
			
		||||
 | 
			
		||||
pub struct MqttHandle {
 | 
			
		||||
    pub agent: String,
 | 
			
		||||
@@ -36,7 +36,7 @@ impl MqttHandle {
 | 
			
		||||
        let message = StatusMessage::new(&self.agent, metrics).to_string()?;
 | 
			
		||||
 | 
			
		||||
        self.client
 | 
			
		||||
            .publish(STATUS_TOPIC, QoS::AtLeastOnce, false, message.as_bytes())
 | 
			
		||||
            .publish(MQTT_TOPIC, QoS::AtLeastOnce, false, message.as_bytes())
 | 
			
		||||
            .await
 | 
			
		||||
            .expect("Failed to publish metrics");
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user