diff --git a/src/admin/fsck/commands.rs b/src/admin/check/commands.rs similarity index 93% rename from src/admin/fsck/commands.rs rename to src/admin/check/commands.rs index f3a2972a..1fbea8f6 100644 --- a/src/admin/fsck/commands.rs +++ b/src/admin/check/commands.rs @@ -19,7 +19,7 @@ pub(super) async fn check_all_users(_body: Vec<&str>) -> Result) -> Result { +pub(super) async fn process(command: CheckCommand, body: Vec<&str>) -> Result { Ok(match command { - FsckCommand::CheckAllUsers => check_all_users(body).await?, + CheckCommand::AllUsers => check_all_users(body).await?, }) } diff --git a/src/admin/handler.rs b/src/admin/handler.rs index ca8545d9..0bd8af9f 100644 --- a/src/admin/handler.rs +++ b/src/admin/handler.rs @@ -14,9 +14,9 @@ pub(crate) use service::admin::{Command, Service}; use service::admin::{CommandOutput, CommandResult, HandlerResult}; use crate::{ - appservice, appservice::AppserviceCommand, debug, debug::DebugCommand, federation, federation::FederationCommand, - fsck, fsck::FsckCommand, media, media::MediaCommand, query, query::QueryCommand, room, room::RoomCommand, server, - server::ServerCommand, services, user, user::UserCommand, + appservice, appservice::AppserviceCommand, check, check::CheckCommand, debug, debug::DebugCommand, federation, + federation::FederationCommand, media, media::MediaCommand, query, query::QueryCommand, room, room::RoomCommand, + server, server::ServerCommand, services, user, user::UserCommand, }; pub(crate) const PAGE_SIZE: usize = 100; @@ -48,17 +48,17 @@ pub(crate) enum AdminCommand { /// - Commands for managing media Media(MediaCommand), + #[command(subcommand)] + /// - Commands for checking integrity + Check(CheckCommand), + #[command(subcommand)] /// - Commands for debugging things Debug(DebugCommand), #[command(subcommand)] - /// - Query all the database getters and iterators + /// - Low-level queries for database getters and iterators Query(QueryCommand), - - #[command(subcommand)] - /// - Query all the database getters and iterators - Fsck(FsckCommand), } #[must_use] @@ -164,7 +164,7 @@ async fn process_admin_command(command: AdminCommand, body: Vec<&str>) -> Result AdminCommand::Server(command) => server::process(command, body).await?, AdminCommand::Debug(command) => debug::process(command, body).await?, AdminCommand::Query(command) => query::process(command, body).await?, - AdminCommand::Fsck(command) => fsck::process(command, body).await?, + AdminCommand::Check(command) => check::process(command, body).await?, }; Ok(reply_message_content) diff --git a/src/admin/mod.rs b/src/admin/mod.rs index 29830a86..f2034724 100644 --- a/src/admin/mod.rs +++ b/src/admin/mod.rs @@ -1,9 +1,9 @@ #![allow(clippy::wildcard_imports)] pub(crate) mod appservice; +pub(crate) mod check; pub(crate) mod debug; pub(crate) mod federation; -pub(crate) mod fsck; pub(crate) mod handler; pub(crate) mod media; pub(crate) mod query;