running parallel tokio tasks for heartbeat and metrics

This commit is contained in:
2025-08-09 22:00:42 +02:00
parent a1bbbedd75
commit ac2fce75a0
7 changed files with 93 additions and 28 deletions

View File

@@ -21,7 +21,7 @@ pub async fn get_memory_info() -> Result<MemoryInfo> {
})
}
pub fn _get_memory_usage(sys: &mut System) -> Result<f64, Box<dyn Error>> {
pub fn _get_memory_usage(sys: &mut System) -> Result<f64, Box<dyn Error + Send + Sync>> {
sys.refresh_memory();
Ok((sys.used_memory() as f64 / sys.total_memory() as f64) * 100.0)
}