From d4529d8c8392b45210b391a069389c2bdb9e1130 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Renault?= Date: Wed, 8 Jan 2025 15:59:30 +0100 Subject: [PATCH] Fix after upgrading sysinfo --- crates/meilisearch/src/option.rs | 4 ++-- crates/xtask/src/bench/env_info.rs | 7 ++----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/crates/meilisearch/src/option.rs b/crates/meilisearch/src/option.rs index 33a8a2f71..4405031ae 100644 --- a/crates/meilisearch/src/option.rs +++ b/crates/meilisearch/src/option.rs @@ -760,8 +760,8 @@ impl MaxMemory { /// Returns the total amount of bytes available or `None` if this system isn't supported. fn total_memory_bytes() -> Option { if sysinfo::IS_SUPPORTED_SYSTEM { - let memory_kind = RefreshKind::new().with_memory(MemoryRefreshKind::new().with_ram()); - let mut system = System::new_with_specifics(memory_kind); + let mem_kind = RefreshKind::nothing().with_memory(MemoryRefreshKind::nothing().with_ram()); + let mut system = System::new_with_specifics(mem_kind); system.refresh_memory(); Some(system.total_memory()) } else { diff --git a/crates/xtask/src/bench/env_info.rs b/crates/xtask/src/bench/env_info.rs index 08dacf915..877e7c2ff 100644 --- a/crates/xtask/src/bench/env_info.rs +++ b/crates/xtask/src/bench/env_info.rs @@ -27,8 +27,7 @@ impl Environment { let unknown_string = String::from("Unknown"); let mut system = System::new(); - system.refresh_cpu(); - system.refresh_cpu_frequency(); + system.refresh_cpu_all(); system.refresh_memory(); let (cpu, frequency) = match system.cpus().first() { @@ -50,9 +49,7 @@ impl Environment { if let Some(os) = System::os_version() { software.push(VersionInfo { name: os, version: String::from("kernel-release") }); } - if let Some(arch) = System::cpu_arch() { - software.push(VersionInfo { name: arch, version: String::from("arch") }); - } + software.push(VersionInfo { name: System::cpu_arch(), version: String::from("arch") }); Self { hostname: System::host_name(),