Update sysinfo to 0.30.5

Signed-off-by: Christian König <ckoenig@posteo.de>
This commit is contained in:
Christian König 2024-02-23 23:18:37 +01:00
parent 6532264b81
commit 979d9d0aa0
No known key found for this signature in database
5 changed files with 9 additions and 12 deletions

View file

@ -57,7 +57,7 @@ getopts = "0.2"
log = "0.4" log = "0.4"
rpassword = "7.0" rpassword = "7.0"
sha1 = "0.10" sha1 = "0.10"
sysinfo = { version = "0.29", default-features = false } sysinfo = { version = "0.30.5", default-features = false }
thiserror = "1.0" thiserror = "1.0"
tokio = { version = "1", features = ["rt", "macros", "signal", "sync", "parking_lot", "process"] } tokio = { version = "1", features = ["rt", "macros", "signal", "sync", "parking_lot", "process"] }
url = "2.2" url = "2.2"

View file

@ -47,7 +47,7 @@ serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0" serde_json = "1.0"
sha1 = { version = "0.10", features = ["oid"] } sha1 = { version = "0.10", features = ["oid"] }
shannon = "0.2" shannon = "0.2"
sysinfo = { version = "0.29", default-features = false } sysinfo = { version = "0.30.5", default-features = false }
thiserror = "1.0" thiserror = "1.0"
time = { version = "0.3", features = ["formatting", "parsing"] } time = { version = "0.3", features = ["formatting", "parsing"] }
tokio = { version = "1", features = ["io-util", "macros", "net", "parking_lot", "rt", "sync", "time"] } tokio = { version = "1", features = ["io-util", "macros", "net", "parking_lot", "rt", "sync", "time"] }

View file

@ -20,7 +20,7 @@ use hyper_rustls::{HttpsConnector, HttpsConnectorBuilder};
use nonzero_ext::nonzero; use nonzero_ext::nonzero;
use once_cell::sync::OnceCell; use once_cell::sync::OnceCell;
use parking_lot::Mutex; use parking_lot::Mutex;
use sysinfo::{System, SystemExt}; use sysinfo::System;
use thiserror::Error; use thiserror::Error;
use url::Url; use url::Url;
@ -105,9 +105,7 @@ pub struct HttpClient {
impl HttpClient { impl HttpClient {
pub fn new(proxy_url: Option<&Url>) -> Self { pub fn new(proxy_url: Option<&Url>) -> Self {
let zero_str = String::from("0"); let zero_str = String::from("0");
let os_version = System::new() let os_version = System::os_version().unwrap_or_else(|| zero_str.clone());
.os_version()
.unwrap_or_else(|| zero_str.clone());
let (spotify_platform, os_version) = match OS { let (spotify_platform, os_version) = match OS {
"android" => ("Android", os_version), "android" => ("Android", os_version),

View file

@ -17,7 +17,7 @@ use hyper::{
use protobuf::{Enum, Message, MessageFull}; use protobuf::{Enum, Message, MessageFull};
use rand::RngCore; use rand::RngCore;
use sha1::{Digest, Sha1}; use sha1::{Digest, Sha1};
use sysinfo::{System, SystemExt}; use sysinfo::System;
use thiserror::Error; use thiserror::Error;
use crate::{ use crate::{
@ -204,9 +204,8 @@ impl SpClient {
.platform_specific_data .platform_specific_data
.mut_or_insert_default(); .mut_or_insert_default();
let sys = System::new(); let os_version = System::os_version().unwrap_or_else(|| String::from("0"));
let os_version = sys.os_version().unwrap_or_else(|| String::from("0")); let kernel_version = System::kernel_version().unwrap_or_else(|| String::from("0"));
let kernel_version = sys.kernel_version().unwrap_or_else(|| String::from("0"));
match os { match os {
"windows" => { "windows" => {

View file

@ -12,7 +12,7 @@ use std::{
str::FromStr, str::FromStr,
time::{Duration, Instant}, time::{Duration, Instant},
}; };
use sysinfo::{System, SystemExt}; use sysinfo::System;
use thiserror::Error; use thiserror::Error;
use url::Url; use url::Url;
@ -1693,7 +1693,7 @@ async fn main() {
Err(e) => { Err(e) => {
sys.refresh_processes(); sys.refresh_processes();
if sys.uptime() <= 1 { if System::uptime() <= 1 {
debug!("Retrying to initialise discovery: {e}"); debug!("Retrying to initialise discovery: {e}");
tokio::time::sleep(DISCOVERY_RETRY_TIMEOUT).await; tokio::time::sleep(DISCOVERY_RETRY_TIMEOUT).await;
} else { } else {