mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-07 00:42:42 +00:00
Ensure new health endpoint builds on MacOS (#1215)
* Add mac build to CI * Always return an error for Health when not linux * Change macos workflow * Rename macos tests * Disable health API test on Mac Co-authored-by: Michael Sproul <michael@sigmaprime.io>
This commit is contained in:
@@ -14,5 +14,7 @@ state_processing = { path = "../../consensus/state_processing" }
|
||||
bls = { path = "../../crypto/bls" }
|
||||
serde = { version = "1.0.110", features = ["derive"] }
|
||||
rayon = "1.3.0"
|
||||
|
||||
[target.'cfg(target_os = "linux")'.dependencies]
|
||||
psutil = "3.1.0"
|
||||
procinfo = "0.4.2"
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
//! Collection of types for the /node HTTP
|
||||
use procinfo::pid;
|
||||
use psutil::process::Process;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use ssz_derive::{Decode, Encode};
|
||||
use types::Slot;
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
use {procinfo::pid, psutil::process::Process};
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Encode, Decode)]
|
||||
/// The current syncing status of the node.
|
||||
pub struct SyncingStatus {
|
||||
@@ -63,6 +64,12 @@ pub struct Health {
|
||||
}
|
||||
|
||||
impl Health {
|
||||
#[cfg(not(target_os = "linux"))]
|
||||
pub fn observe() -> Result<Self, String> {
|
||||
Err("Health is only available on Linux".into())
|
||||
}
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
pub fn observe() -> Result<Self, String> {
|
||||
let process =
|
||||
Process::current().map_err(|e| format!("Unable to get current process: {:?}", e))?;
|
||||
|
||||
Reference in New Issue
Block a user