improve appservice service async interfaces

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk 2025-04-07 03:28:51 +00:00
parent 04d7f7f626
commit cd4e6b61a9
2 changed files with 36 additions and 45 deletions

View file

@ -1,5 +1,6 @@
use clap::Subcommand;
use conduwuit::Result;
use futures::TryStreamExt;
use crate::Command;
@ -31,7 +32,7 @@ pub(super) async fn process(subcommand: AppserviceCommand, context: &Command<'_>
},
| AppserviceCommand::All => {
let timer = tokio::time::Instant::now();
let results = services.appservice.all().await;
let results: Vec<_> = services.appservice.iter_db_ids().try_collect().await?;
let query_time = timer.elapsed();
write!(context, "Query completed in {query_time:?}:\n\n```rs\n{results:#?}\n```")