Files
tuwunel/src/admin/query/pusher.rs
2026-01-17 01:39:49 +00:00

25 lines
665 B
Rust

use clap::Subcommand;
use ruma::OwnedUserId;
use tuwunel_core::Result;
use tuwunel_macros::{admin_command, admin_command_dispatch};
#[admin_command_dispatch]
#[derive(Debug, Subcommand)]
pub(crate) enum PusherCommand {
/// - Returns all the pushers for the user.
GetPushers {
/// Full user ID
user_id: OwnedUserId,
},
}
#[admin_command]
pub(super) async fn get_pushers(&self, user_id: OwnedUserId) -> Result {
let timer = tokio::time::Instant::now();
let results = self.services.pusher.get_pushers(&user_id).await;
let query_time = timer.elapsed();
self.write_string(format!("Query completed in {query_time:?}:\n\n```rs\n{results:#?}```"))
.await
}