diff options
| author | Fuwn <[email protected]> | 2021-07-01 01:23:56 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2021-07-01 01:23:56 -0700 |
| commit | a6d0e588e0bfac237d8bcdc80b4f039910bdff22 (patch) | |
| tree | 4e63ce615b725862ba153ed52a0f8cfb13729cf1 | |
| parent | Merge pull request #50 from Whirlsplash/renovate/sysinfo-0.x (diff) | |
| download | whirl-a6d0e588e0bfac237d8bcdc80b4f039910bdff22.tar.xz whirl-a6d0e588e0bfac237d8bcdc80b4f039910bdff22.zip | |
refactor(whirl_api): use the existing `System` to grab uptime instead of constructing a new one
| -rw-r--r-- | crates/whirl_api/src/routes/stats/mod.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/whirl_api/src/routes/stats/mod.rs b/crates/whirl_api/src/routes/stats/mod.rs index c0f8f72..c4172a4 100644 --- a/crates/whirl_api/src/routes/stats/mod.rs +++ b/crates/whirl_api/src/routes/stats/mod.rs @@ -24,7 +24,7 @@ pub fn statistics() -> HttpResponse { os_type: sys.name().unwrap(), release: sys.kernel_version().unwrap(), uptime: whirl_common::system::seconds_to_hrtime( - usize::try_from(sysinfo::System::new().uptime()).unwrap(), + usize::try_from(sys.uptime()).unwrap(), ), }, process: StatisticsProcess { |