mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-11-23 00:47:33 +00:00
fix: Move federation mutex lock to room worker
This commit is contained in:
2 files changed
+8
-7
No files matched your search
@@ -335,13 +335,6 @@ async fn handle_room(
|
||||
room_id: OwnedRoomId,
|
||||
pdus: impl Iterator<Item = Pdu> + Send,
|
||||
) -> std::result::Result<Vec<(OwnedEventId, Result)>, TransactionError> {
|
||||
let _room_lock = services
|
||||
.rooms
|
||||
.event_handler
|
||||
.mutex_federation
|
||||
.lock(room_id.as_str())
|
||||
.await;
|
||||
|
||||
let room_id = &room_id;
|
||||
let mut pdu_map: HashMap<OwnedEventId, CanonicalJsonObject> = pdus
|
||||
.into_iter()
|
||||
|
||||
@@ -64,7 +64,9 @@ impl crate::Service for Service {
|
||||
loop {
|
||||
let job = tokio::select! {
|
||||
() = self.shutdown.notified() => {
|
||||
conduwuit::info!("Shutting down");
|
||||
yielding.close();
|
||||
recv.close();
|
||||
break;
|
||||
},
|
||||
room_id = yielding.recv() => {
|
||||
@@ -159,6 +161,12 @@ impl Service {
|
||||
break;
|
||||
};
|
||||
conduwuit::debug!(event_id=%job.event_id, origin=%job.origin, "Handling incoming job");
|
||||
let _room_lock = self
|
||||
.services
|
||||
.event_handler
|
||||
.mutex_federation
|
||||
.lock(room_id.as_str())
|
||||
.await;
|
||||
|
||||
let event_type = KeyValue::new(
|
||||
"type",
|
||||
|
||||
Reference in new issue
Block a user