Skip to content

Commit

Permalink
feat(server): filter disks by total space
Browse files Browse the repository at this point in the history
  • Loading branch information
uonr committed Dec 20, 2024
1 parent 200c360 commit 43b9e06
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions apps/server/src/info/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ impl HealthCheck {
let database = ConnectionState::database().await.into();
system.refresh_memory();
let disks = Disks::new_with_refreshed_list();
let gib_in_bytes = 1024 * 1024 * 1024;
HealthCheck {
timestamp_sec: std::time::SystemTime::now()
.duration_since(std::time::UNIX_EPOCH)
Expand All @@ -109,6 +110,7 @@ impl HealthCheck {
available: disk.available_space(),
total: disk.total_space(),
})
.filter(|disk| disk.total > gib_in_bytes)
.collect(),
memory_total: system.total_memory(),
memory_used: system.used_memory(),
Expand Down

0 comments on commit 43b9e06

Please sign in to comment.