diff --git a/WatcherAgent/src/main.rs b/WatcherAgent/src/main.rs index 309e070..78ae2bd 100644 --- a/WatcherAgent/src/main.rs +++ b/WatcherAgent/src/main.rs @@ -6,7 +6,7 @@ use nvml_wrapper::Nvml; use reqwest::{Client, StatusCode}; use serde::{Deserialize, Serialize}; use std::{error::Error, fs, process::Command, time::Duration}; -use sysinfo::{Components, Disks, System}; +use sysinfo::{Disks, System}; use tokio::time::{interval, sleep, Instant}; // Windows specific imports @@ -422,6 +422,7 @@ fn get_cpu_temp() -> Option { println!("Attempting to get CPU temperature..."); #[cfg(target_os = "linux")] { + use sysinfo::Components; println!("Attempting to get CPU temperature on Linux..."); let mut sys = System::new_all(); //let components = Components::new_with_refreshed_list(); @@ -436,14 +437,13 @@ fn get_cpu_temp() -> Option { } } - Some(0.0) + None } #[cfg(target_os = "windows")] - use systemstat::{Platform, System as SysStat}; { + use systemstat::{Platform, System as SysStat}; let sys = SysStat::new(); - match sys.cpu_temp() { Ok(temp) => return Some(temp), Err(e) => { @@ -459,8 +459,6 @@ fn get_cpu_temp() -> Option { println!("CPU temperature retrieval not supported on this OS."); None } - - None } /*