disable pprof on win (#524)

Signed-off-by: junxiang Mu <1948535941@qq.com>
This commit is contained in:
guojidan
2025-09-12 18:43:45 +08:00
committed by GitHub
parent 9ce867f585
commit f372ccf4a8
2 changed files with 3 additions and 0 deletions

View File

@@ -81,6 +81,7 @@ pub mod sts;
pub mod tier;
pub mod trace;
pub mod user;
#[cfg(not(target_os = "windows"))]
use pprof::protos::Message;
use urlencoding::decode;

View File

@@ -215,12 +215,14 @@ pub fn make_admin_route(console_enabled: bool) -> std::io::Result<impl S3Route>
)?;
// Performance profiling endpoints (available on all platforms, with platform-specific responses)
#[cfg(not(target_os = "windows"))]
r.insert(
Method::GET,
format!("{}{}", ADMIN_PREFIX, "/debug/pprof/profile").as_str(),
AdminOperation(&handlers::ProfileHandler {}),
)?;
#[cfg(not(target_os = "windows"))]
r.insert(
Method::GET,
format!("{}{}", ADMIN_PREFIX, "/debug/pprof/status").as_str(),