mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-01-10 21:44:34 +01:00
Fix after upgrading sysinfo
This commit is contained in:
parent
5e8144b0e1
commit
d4529d8c83
@ -760,8 +760,8 @@ impl MaxMemory {
|
|||||||
/// Returns the total amount of bytes available or `None` if this system isn't supported.
|
/// Returns the total amount of bytes available or `None` if this system isn't supported.
|
||||||
fn total_memory_bytes() -> Option<u64> {
|
fn total_memory_bytes() -> Option<u64> {
|
||||||
if sysinfo::IS_SUPPORTED_SYSTEM {
|
if sysinfo::IS_SUPPORTED_SYSTEM {
|
||||||
let memory_kind = RefreshKind::new().with_memory(MemoryRefreshKind::new().with_ram());
|
let mem_kind = RefreshKind::nothing().with_memory(MemoryRefreshKind::nothing().with_ram());
|
||||||
let mut system = System::new_with_specifics(memory_kind);
|
let mut system = System::new_with_specifics(mem_kind);
|
||||||
system.refresh_memory();
|
system.refresh_memory();
|
||||||
Some(system.total_memory())
|
Some(system.total_memory())
|
||||||
} else {
|
} else {
|
||||||
|
@ -27,8 +27,7 @@ impl Environment {
|
|||||||
|
|
||||||
let unknown_string = String::from("Unknown");
|
let unknown_string = String::from("Unknown");
|
||||||
let mut system = System::new();
|
let mut system = System::new();
|
||||||
system.refresh_cpu();
|
system.refresh_cpu_all();
|
||||||
system.refresh_cpu_frequency();
|
|
||||||
system.refresh_memory();
|
system.refresh_memory();
|
||||||
|
|
||||||
let (cpu, frequency) = match system.cpus().first() {
|
let (cpu, frequency) = match system.cpus().first() {
|
||||||
@ -50,9 +49,7 @@ impl Environment {
|
|||||||
if let Some(os) = System::os_version() {
|
if let Some(os) = System::os_version() {
|
||||||
software.push(VersionInfo { name: os, version: String::from("kernel-release") });
|
software.push(VersionInfo { name: os, version: String::from("kernel-release") });
|
||||||
}
|
}
|
||||||
if let Some(arch) = System::cpu_arch() {
|
software.push(VersionInfo { name: System::cpu_arch(), version: String::from("arch") });
|
||||||
software.push(VersionInfo { name: arch, version: String::from("arch") });
|
|
||||||
}
|
|
||||||
|
|
||||||
Self {
|
Self {
|
||||||
hostname: System::host_name(),
|
hostname: System::host_name(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user