running parallel tokio tasks for heartbeat and metrics
This commit is contained in:
@@ -11,7 +11,7 @@ pub struct GpuInfo {
|
||||
pub vram_used: Option<f64>,
|
||||
}
|
||||
|
||||
pub async fn get_gpu_info() -> Result<GpuInfo, Box<dyn Error>> {
|
||||
pub async fn get_gpu_info() -> Result<GpuInfo, Box<dyn Error + Send + Sync>> {
|
||||
match get_gpu_metrics() {
|
||||
Ok((gpu_temp, gpu_load, vram_used, vram_total)) => {
|
||||
let gpu_name = detect_gpu_name();
|
||||
@@ -37,7 +37,7 @@ pub async fn get_gpu_info() -> Result<GpuInfo, Box<dyn Error>> {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_gpu_metrics() -> Result<(f64, f64, f64, f64), Box<dyn Error>> {
|
||||
pub fn get_gpu_metrics() -> Result<(f64, f64, f64, f64), Box<dyn Error + Send + Sync>> {
|
||||
let nvml = Nvml::init();
|
||||
if let Ok(nvml) = nvml {
|
||||
if let Ok(device) = nvml.device_by_index(0) {
|
||||
|
Reference in New Issue
Block a user