From 406531c99147394c4bdacf9b1113bcac4e913a7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Renault?= Date: Tue, 16 Jan 2024 16:49:51 +0100 Subject: [PATCH] Fix sysinfo --- meilisearch/src/option.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/meilisearch/src/option.rs b/meilisearch/src/option.rs index befb96294..3cff14aa0 100644 --- a/meilisearch/src/option.rs +++ b/meilisearch/src/option.rs @@ -20,7 +20,7 @@ use rustls::server::{ use rustls::RootCertStore; use rustls_pemfile::{certs, pkcs8_private_keys, rsa_private_keys}; use serde::{Deserialize, Serialize}; -use sysinfo::{RefreshKind, System}; +use sysinfo::{MemoryRefreshKind, RefreshKind, System}; use url::Url; const POSSIBLE_ENV: [&str; 2] = ["development", "production"]; @@ -633,8 +633,8 @@ impl MaxMemory { /// Returns the total amount of bytes available or `None` if this system isn't supported. fn total_memory_bytes() -> Option { - if System::IS_SUPPORTED { - let memory_kind = RefreshKind::new().with_memory(); + 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); system.refresh_memory(); Some(system.total_memory())