mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-11-13 12:16:54 +00:00
perf: Fetch auth chain events in parallel
This commit is contained in:
1 file changed
+7
-2
@@ -1,7 +1,10 @@
|
||||
use std::{borrow::Borrow, iter::once};
|
||||
|
||||
use axum::extract::State;
|
||||
use conduwuit::{Err, Event, Result, info, utils::stream::ReadyExt};
|
||||
use conduwuit::{
|
||||
Err, Event, Result, info,
|
||||
utils::stream::{BroadbandExt, ReadyExt},
|
||||
};
|
||||
use futures::StreamExt;
|
||||
use ruma::api::federation::authorization::get_event_authorization;
|
||||
|
||||
@@ -64,7 +67,9 @@ pub(crate) async fn get_event_authorization_route(
|
||||
.auth_chain
|
||||
.event_ids_iter(&body.room_id, once(body.event_id.borrow()))
|
||||
.ready_filter_map(Result::ok)
|
||||
.filter_map(|id| async move { services.rooms.timeline.get_pdu_json(&id).await.ok() })
|
||||
.broad_filter_map(
|
||||
|id| async move { services.rooms.timeline.get_pdu_json(&id).await.ok() },
|
||||
)
|
||||
.then(|pdu| services.sending.convert_to_outgoing_federation_event(pdu))
|
||||
.collect()
|
||||
.await;
|
||||
|
||||
Reference in new issue
Block a user