Skip to main content

tuwunel_admin/debug/event_fetcher/
backfill.rs

1use std::num::NonZeroUsize;
2
3use ruma::{OwnedEventId, OwnedRoomId, OwnedServerName};
4use tuwunel_core::Result;
5use tuwunel_service::fetcher::{Op, Opts};
6
7use super::{base_opts, run};
8use crate::admin_command;
9
10#[admin_command]
11pub(super) async fn event_fetcher_backfill(
12	&self,
13	room_id: OwnedRoomId,
14	event_id: OwnedEventId,
15	server: Option<OwnedServerName>,
16	attempt_limit: Option<usize>,
17	limit: Option<usize>,
18	verify: bool,
19) -> Result {
20	let opts = Opts {
21		backfill_limit: limit.and_then(NonZeroUsize::new),
22		..base_opts(Op::Backfill, room_id, event_id, server, attempt_limit, verify)
23	};
24
25	run(self, opts).await
26}