mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-11-14 20:56:49 +00:00
perf: Don't re-process events as outliers
This commit is contained in:
1 file changed
+7
@@ -77,6 +77,13 @@ where
|
|||||||
incoming_pdu
|
incoming_pdu
|
||||||
.insert("event_id".to_owned(), CanonicalJsonValue::String(event_id.as_str().to_owned()));
|
.insert("event_id".to_owned(), CanonicalJsonValue::String(event_id.as_str().to_owned()));
|
||||||
|
|
||||||
|
if let Ok(pdu_event) = self.services.timeline.get_pdu(event_id).await {
|
||||||
|
debug!(
|
||||||
|
"Already have event {event_id} as an outlier or timeline event, not re-processing"
|
||||||
|
);
|
||||||
|
return Ok((pdu_event, incoming_pdu));
|
||||||
|
}
|
||||||
|
|
||||||
let pdu_event = serde_json::from_value::<PduEvent>(
|
let pdu_event = serde_json::from_value::<PduEvent>(
|
||||||
serde_json::to_value(&incoming_pdu).expect("CanonicalJsonObj is a valid JsonValue"),
|
serde_json::to_value(&incoming_pdu).expect("CanonicalJsonObj is a valid JsonValue"),
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in new issue
Block a user