From 18ea6c3e2e94a808f5fa0bb58f3bbba223ee613c Mon Sep 17 00:00:00 2001 From: pawan Date: Mon, 24 May 2021 16:34:58 +0530 Subject: [PATCH] Fix linux imports --- common/eth2/src/lighthouse.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/common/eth2/src/lighthouse.rs b/common/eth2/src/lighthouse.rs index dbdc72d5767..f81fc607fcb 100644 --- a/common/eth2/src/lighthouse.rs +++ b/common/eth2/src/lighthouse.rs @@ -6,13 +6,10 @@ use crate::{ BeaconNodeHttpClient, DepositData, Error, Eth1Data, Hash256, StateId, StatusCode, }; use proto_array::core::ProtoArray; -use psutil::cpu::os::linux::CpuTimesExt; -use psutil::memory::os::linux::VirtualMemoryExt; use reqwest::IntoUrl; use serde::{Deserialize, Serialize}; use ssz::Decode; use ssz_derive::{Decode, Encode}; -use std::time::UNIX_EPOCH; pub use eth2_libp2p::{types::SyncState, PeerInfo}; @@ -79,7 +76,10 @@ pub struct ValidatorInclusionData { } #[cfg(target_os = "linux")] -use {procinfo::pid, psutil::process::Process}; +use { + procinfo::pid, psutil::cpu::os::linux::CpuTimesExt, + psutil::memory::os::linux::VirtualMemoryExt, psutil::process::Process, +}; /// Reports on the health of the Lighthouse instance. #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] @@ -180,7 +180,7 @@ impl SystemHealth { let boot_time = psutil::host::boot_time() .map_err(|e| format!("Unable to get system boot time: {:?}", e))? - .duration_since(UNIX_EPOCH) + .duration_since(std::time::UNIX_EPOCH) .map_err(|e| format!("Boot time is lower than unix epoch: {}", e))? .as_secs();