Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump system to 0.30.5 #1073

Merged
merged 2 commits into from
Feb 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 26 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion bzl-remote-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ redis = { version = "0.24.0", features = ["tokio-comp", "connection-manager"] }
urlencoding = "2.1.3"
http = "0.2.11"
http-body = "0.4.5"
sysinfo = "0.29.11"
sysinfo = "0.30.5"


[build-dependencies]
Expand Down
9 changes: 3 additions & 6 deletions bzl-remote-core/src/cache_service/http_endpoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,10 @@ use http::Uri;
use hyper::{Body, Request, Response, StatusCode};
use prost::Message;
use sha2::Digest;
use sysinfo::System;
use sysinfo::Disks;
// Import the multer types.
use tempfile::NamedTempFile;

use sysinfo::DiskExt;
use sysinfo::SystemExt;
use tokio::io::AsyncWriteExt;
use tokio::sync::Mutex;

Expand Down Expand Up @@ -69,7 +67,6 @@ pub enum HttpEndpointError {

#[derive(Debug)]
struct HealthStatus {
system: System,
last_update: Instant,
last_status_code: StatusCode,
last_description: String,
Expand All @@ -78,7 +75,6 @@ struct HealthStatus {
impl Default for HealthStatus {
fn default() -> Self {
Self {
system: System::new_all(),
last_update: Instant::now(),
last_status_code: StatusCode::OK,
last_description: String::from("HEALTHY"),
Expand All @@ -92,7 +88,8 @@ impl HealthStatus {
self.last_update = now;
self.last_description = String::from("OK -- unable to find disk space");
self.last_status_code = StatusCode::OK;
for disk in (&mut self.system).disks_mut() {
let mut disks = Disks::new_with_refreshed_list();
for disk in disks.list_mut() {
if disk.mount_point() == PathBuf::from("/") {
disk.refresh();
let available_space = disk.available_space() as f64 / disk.total_space() as f64;
Expand Down
Loading