Optimize Pdu prev_events and auth_events containers.
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
use std::{ops::Range, time::Duration};
|
||||
|
||||
use futures::FutureExt;
|
||||
use ruma::{
|
||||
CanonicalJsonObject, EventId, MilliSecondsSinceUnixEpoch, RoomId, RoomVersionId, ServerName,
|
||||
};
|
||||
@@ -62,6 +63,7 @@ pub(super) async fn handle_prev_pdu(
|
||||
room_version,
|
||||
create_event_id,
|
||||
)
|
||||
.boxed()
|
||||
.await?;
|
||||
|
||||
Ok(())
|
||||
|
||||
@@ -212,13 +212,11 @@ pub(super) async fn upgrade_outlier_to_timeline_pdu(
|
||||
.services
|
||||
.state_compressor
|
||||
.save_state(room_id, new_room_state)
|
||||
.boxed()
|
||||
.await?;
|
||||
|
||||
self.services
|
||||
.state
|
||||
.force_state(room_id, shortstatehash, added, removed, &state_lock)
|
||||
.boxed()
|
||||
.await?;
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ use tuwunel_core::{
|
||||
Error, Result, err, implement,
|
||||
matrix::{
|
||||
event::{Event, StateKey, TypeExt},
|
||||
pdu::{EventHash, PduBuilder, PduEvent},
|
||||
pdu::{EventHash, PduBuilder, PduEvent, PrevEvents},
|
||||
room_version,
|
||||
state_res::{self},
|
||||
},
|
||||
@@ -43,7 +43,7 @@ pub async fn create_hash_and_sign_event(
|
||||
timestamp,
|
||||
} = pdu_builder;
|
||||
|
||||
let prev_events: Vec<OwnedEventId> = self
|
||||
let prev_events: PrevEvents = self
|
||||
.services
|
||||
.state
|
||||
.get_forward_extremities(room_id)
|
||||
|
||||
Reference in New Issue
Block a user