dont return "Allocator" header for server memory-usage if empty
Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
parent
0f13ada300
commit
c4beb7d462
1 changed files with 6 additions and 1 deletions
|
@ -31,7 +31,12 @@ pub(crate) async fn memory_usage(_body: Vec<&str>) -> Result<RoomMessageEventCon
|
||||||
let response2 = crate::alloc::memory_usage();
|
let response2 = crate::alloc::memory_usage();
|
||||||
|
|
||||||
Ok(RoomMessageEventContent::text_plain(format!(
|
Ok(RoomMessageEventContent::text_plain(format!(
|
||||||
"Services:\n{response0}\n\nDatabase:\n{response1}\nAllocator:\n{response2}"
|
"Services:\n{response0}\n\nDatabase:\n{response1}\n{}",
|
||||||
|
if !response2.is_empty() {
|
||||||
|
"Allocator:\n{response2}"
|
||||||
|
} else {
|
||||||
|
""
|
||||||
|
}
|
||||||
)))
|
)))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue