diff --git a/src/admin/admin.rs b/src/admin/admin.rs index 2d2b98e8..1884edbd 100644 --- a/src/admin/admin.rs +++ b/src/admin/admin.rs @@ -3,7 +3,6 @@ use tuwunel_core::Result; use crate::{ appservice::{self, AppserviceCommand}, - check::{self, CheckCommand}, context::Context, debug::{self, DebugCommand}, federation::{self, FederationCommand}, @@ -42,10 +41,6 @@ pub(super) enum AdminCommand { /// - Commands for managing media Media(MediaCommand), - #[command(subcommand)] - /// - Commands for checking integrity - Check(CheckCommand), - #[command(subcommand)] /// - Commands for debugging things Debug(DebugCommand), @@ -72,7 +67,6 @@ pub(super) async fn process(command: AdminCommand, context: &Context<'_>) -> Res | Server(command) => server::process(command, context).await, | Debug(command) => debug::process(command, context).await, | Query(command) => query::process(command, context).await, - | Check(command) => check::process(command, context).await, | Token(command) => token::process(command, context).await, } } diff --git a/src/admin/check/commands.rs b/src/admin/check/commands.rs deleted file mode 100644 index 7c331a2f..00000000 --- a/src/admin/check/commands.rs +++ /dev/null @@ -1,32 +0,0 @@ -use futures::StreamExt; -use tuwunel_core::Result; -use tuwunel_macros::implement; - -use crate::Context; - -/// Uses the iterator in `src/database/key_value/users.rs` to iterator over -/// every user in our database (remote and local). Reports total count, any -/// errors if there were any, etc -#[implement(Context, params = "<'_>")] -pub(super) async fn check_all_users(&self) -> Result { - let timer = tokio::time::Instant::now(); - let users = self - .services - .users - .stream() - .map(ToOwned::to_owned) - .collect::>() - .await; - let query_time = timer.elapsed(); - - let total = users.len(); - let err_count = users.iter().filter(|_user| false).count(); - let ok_count = users.iter().filter(|_user| true).count(); - - self.write_str(&format!( - "Database query completed in {query_time:?}:\n\n```\nTotal entries: \ - {total:?}\nFailure/Invalid user count: {err_count:?}\nSuccess/Valid user count: \ - {ok_count:?}\n```" - )) - .await -} diff --git a/src/admin/check/mod.rs b/src/admin/check/mod.rs deleted file mode 100644 index 408e6ba2..00000000 --- a/src/admin/check/mod.rs +++ /dev/null @@ -1,12 +0,0 @@ -mod commands; - -use clap::Subcommand; -use tuwunel_core::Result; - -use crate::admin_command_dispatch; - -#[admin_command_dispatch] -#[derive(Debug, Subcommand)] -pub(super) enum CheckCommand { - CheckAllUsers, -} diff --git a/src/admin/mod.rs b/src/admin/mod.rs index 2e969411..d763c727 100644 --- a/src/admin/mod.rs +++ b/src/admin/mod.rs @@ -7,7 +7,6 @@ mod tests; pub(crate) mod utils; pub(crate) mod appservice; -pub(crate) mod check; pub(crate) mod debug; pub(crate) mod federation; pub(crate) mod media;