Files
continuwuity/src/admin/query/pusher.rs
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

30 lines
692 B
Rust
Raw Normal View History

use clap::Subcommand;
2024-12-14 21:58:01 -05:00
use conduwuit::Result;
use ruma::OwnedUserId;
use crate::Context;
#[derive(Debug, Subcommand)]
2025-05-24 00:28:09 +01:00
pub enum PusherCommand {
/// - Returns all the pushers for the user.
GetPushers {
/// Full user ID
user_id: OwnedUserId,
},
}
pub(super) async fn process(subcommand: PusherCommand, context: &Context<'_>) -> Result {
let services = context.services;
match subcommand {
| PusherCommand::GetPushers { user_id } => {
let timer = tokio::time::Instant::now();
2024-08-08 17:18:30 +00:00
let results = services.pusher.get_pushers(&user_id).await;
let query_time = timer.elapsed();
2025-01-04 16:57:07 +00:00
write!(context, "Query completed in {query_time:?}:\n\n```rs\n{results:#?}\n```")
},
}
2025-01-04 16:57:07 +00:00
.await
}