Skip to content

Commit 979ab1b

Browse files
committed
utils: add ?force=true hint for CPU profiler
1 parent 0b90320 commit 979ab1b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

libs/utils/src/http/endpoint.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,11 @@ pub async fn profile_cpu_handler(req: Request<Body>) -> Result<Response<Body>, A
372372
match PROFILE_LOCK.try_lock() {
373373
Ok(lock) => break lock,
374374
Err(_) if force => PROFILE_CANCEL.notify_waiters(),
375-
Err(_) => return Err(ApiError::Conflict("profiler already running".into())),
375+
Err(_) => {
376+
return Err(ApiError::Conflict(
377+
"profiler already running (use ?force=true to cancel it)".into(),
378+
))
379+
}
376380
}
377381
tokio::time::sleep(Duration::from_millis(1)).await; // don't busy-wait
378382
};

0 commit comments

Comments
 (0)