delete useless admin commands

To clear caches, restart the server. We may want to consider adding the
cache sizes and database memory usage as metrics in the future.
This commit is contained in:
Charles Hall 2024-09-30 20:25:23 -07:00
parent 6a44d0af2b
commit e0cf163486
No known key found for this signature in database
GPG key ID: 7B8E0645816E07CF
7 changed files with 11 additions and 195 deletions

View file

@ -141,21 +141,6 @@ enum AdminCommand {
event_id: Box<EventId>,
},
/// Print database memory usage statistics
MemoryUsage,
/// Clears all of Grapevine's database caches with index smaller than the
/// amount
ClearDatabaseCaches {
amount: u32,
},
/// Clears all of Grapevine's service caches with index smaller than the
/// amount
ClearServiceCaches {
amount: u32,
},
/// Reset user password
ResetPassword {
/// Username of the user for whom the password should be reset
@ -661,28 +646,6 @@ impl Service {
}
}
}
AdminCommand::MemoryUsage => {
let response1 = services().memory_usage().await;
let response2 = services().globals.db.memory_usage();
RoomMessageEventContent::text_plain(format!(
"Services:\n{response1}\n\nDatabase:\n{response2}"
))
}
AdminCommand::ClearDatabaseCaches {
amount,
} => {
services().globals.db.clear_caches(amount);
RoomMessageEventContent::text_plain("Done.")
}
AdminCommand::ClearServiceCaches {
amount,
} => {
services().clear_caches(amount).await;
RoomMessageEventContent::text_plain("Done.")
}
AdminCommand::ResetPassword {
username,
} => {