add corks to coalesce writes for several heavy calltrees.

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk 2024-03-21 04:13:08 -07:00 committed by June
parent 3f60365cc6
commit 61b1d6d869
3 changed files with 13 additions and 0 deletions

View file

@ -221,6 +221,9 @@ impl Service {
leaves: Vec<OwnedEventId>,
state_lock: &MutexGuard<'_, ()>, // Take mutex guard to make sure users get the room state mutex
) -> Result<Vec<u8>> {
// Coalesce database writes for the remainder of this scope.
let _cork = services().globals.db.cork_and_flush()?;
let shortroomid = services().rooms.short.get_shortroomid(&pdu.room_id)?.expect("room exists");
// Make unsigned fields correct. This is not properly documented in the spec,