rename fsck to check
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
parent
2387f7f955
commit
9d1db7d171
4 changed files with 15 additions and 15 deletions
|
@ -19,7 +19,7 @@ pub(super) async fn check_all_users(_body: Vec<&str>) -> Result<RoomMessageEvent
|
||||||
|
|
||||||
let message = format!(
|
let message = format!(
|
||||||
"Database query completed in {query_time:?}:\n\n```\nTotal entries: {total:?}\nFailure/Invalid user count: \
|
"Database query completed in {query_time:?}:\n\n```\nTotal entries: {total:?}\nFailure/Invalid user count: \
|
||||||
{err_count:?}\nSuccess/Valid user count: {ok_count:?}```"
|
{err_count:?}\nSuccess/Valid user count: {ok_count:?}\n```"
|
||||||
);
|
);
|
||||||
|
|
||||||
Ok(RoomMessageEventContent::notice_markdown(message))
|
Ok(RoomMessageEventContent::notice_markdown(message))
|
|
@ -8,12 +8,12 @@ use self::commands::*;
|
||||||
|
|
||||||
#[cfg_attr(test, derive(Debug))]
|
#[cfg_attr(test, derive(Debug))]
|
||||||
#[derive(Subcommand)]
|
#[derive(Subcommand)]
|
||||||
pub(super) enum FsckCommand {
|
pub(super) enum CheckCommand {
|
||||||
CheckAllUsers,
|
AllUsers,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(super) async fn process(command: FsckCommand, body: Vec<&str>) -> Result<RoomMessageEventContent> {
|
pub(super) async fn process(command: CheckCommand, body: Vec<&str>) -> Result<RoomMessageEventContent> {
|
||||||
Ok(match command {
|
Ok(match command {
|
||||||
FsckCommand::CheckAllUsers => check_all_users(body).await?,
|
CheckCommand::AllUsers => check_all_users(body).await?,
|
||||||
})
|
})
|
||||||
}
|
}
|
|
@ -14,9 +14,9 @@ pub(crate) use service::admin::{Command, Service};
|
||||||
use service::admin::{CommandOutput, CommandResult, HandlerResult};
|
use service::admin::{CommandOutput, CommandResult, HandlerResult};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
appservice, appservice::AppserviceCommand, debug, debug::DebugCommand, federation, federation::FederationCommand,
|
appservice, appservice::AppserviceCommand, check, check::CheckCommand, debug, debug::DebugCommand, federation,
|
||||||
fsck, fsck::FsckCommand, media, media::MediaCommand, query, query::QueryCommand, room, room::RoomCommand, server,
|
federation::FederationCommand, media, media::MediaCommand, query, query::QueryCommand, room, room::RoomCommand,
|
||||||
server::ServerCommand, services, user, user::UserCommand,
|
server, server::ServerCommand, services, user, user::UserCommand,
|
||||||
};
|
};
|
||||||
pub(crate) const PAGE_SIZE: usize = 100;
|
pub(crate) const PAGE_SIZE: usize = 100;
|
||||||
|
|
||||||
|
@ -48,17 +48,17 @@ pub(crate) enum AdminCommand {
|
||||||
/// - Commands for managing media
|
/// - Commands for managing media
|
||||||
Media(MediaCommand),
|
Media(MediaCommand),
|
||||||
|
|
||||||
|
#[command(subcommand)]
|
||||||
|
/// - Commands for checking integrity
|
||||||
|
Check(CheckCommand),
|
||||||
|
|
||||||
#[command(subcommand)]
|
#[command(subcommand)]
|
||||||
/// - Commands for debugging things
|
/// - Commands for debugging things
|
||||||
Debug(DebugCommand),
|
Debug(DebugCommand),
|
||||||
|
|
||||||
#[command(subcommand)]
|
#[command(subcommand)]
|
||||||
/// - Query all the database getters and iterators
|
/// - Low-level queries for database getters and iterators
|
||||||
Query(QueryCommand),
|
Query(QueryCommand),
|
||||||
|
|
||||||
#[command(subcommand)]
|
|
||||||
/// - Query all the database getters and iterators
|
|
||||||
Fsck(FsckCommand),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[must_use]
|
#[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::Server(command) => server::process(command, body).await?,
|
||||||
AdminCommand::Debug(command) => debug::process(command, body).await?,
|
AdminCommand::Debug(command) => debug::process(command, body).await?,
|
||||||
AdminCommand::Query(command) => query::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)
|
Ok(reply_message_content)
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
#![allow(clippy::wildcard_imports)]
|
#![allow(clippy::wildcard_imports)]
|
||||||
|
|
||||||
pub(crate) mod appservice;
|
pub(crate) mod appservice;
|
||||||
|
pub(crate) mod check;
|
||||||
pub(crate) mod debug;
|
pub(crate) mod debug;
|
||||||
pub(crate) mod federation;
|
pub(crate) mod federation;
|
||||||
pub(crate) mod fsck;
|
|
||||||
pub(crate) mod handler;
|
pub(crate) mod handler;
|
||||||
pub(crate) mod media;
|
pub(crate) mod media;
|
||||||
pub(crate) mod query;
|
pub(crate) mod query;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue