make async-backtrace optional
This commit is contained in:
parent
17353cf8e1
commit
e4aac7930f
4 changed files with 44 additions and 21 deletions
|
|
@ -85,7 +85,17 @@ impl TestPeerMetadata {
|
|||
|
||||
async fn debug_server() -> anyhow::Result<()> {
|
||||
async fn backtraces() -> impl IntoResponse {
|
||||
async_backtrace::taskdump_tree(true)
|
||||
#[cfg(feature = "async-bt")]
|
||||
{
|
||||
async_backtrace::taskdump_tree(true)
|
||||
}
|
||||
#[cfg(not(feature = "async-bt"))]
|
||||
{
|
||||
use crate::ApiError;
|
||||
ApiError::from(anyhow::anyhow!(
|
||||
"backtraces not enabled, enable async-bt feature"
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
let app = Router::new().route("/backtrace", get(backtraces));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue