Skip to content

Commit 87f519b

Browse files
committed
fix: foundry and pprof conflict
1 parent 0fcfd09 commit 87f519b

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

crates/node/src/pprof.rs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -191,17 +191,7 @@ impl PprofConfig {
191191
match report.pprof() {
192192
Ok(profile) => {
193193
// The profile object needs to be converted to bytes
194-
let body = match profile.write_to_bytes() {
195-
Ok(bytes) => bytes,
196-
Err(e) => {
197-
error!("Failed to encode profile: {}", e);
198-
let error_msg = format!("Failed to encode profile: {}", e);
199-
return Ok(Response::builder()
200-
.status(StatusCode::INTERNAL_SERVER_ERROR)
201-
.body(Full::new(Bytes::from(error_msg)))
202-
.unwrap());
203-
}
204-
};
194+
let body: Vec<u8> = profile.encode_to_vec();
205195

206196
info!("Successfully collected CPU profile ({} bytes)", body.len());
207197

0 commit comments

Comments
 (0)