add corks to coalesce writes for several heavy calltrees.

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk authored and June committed 2024-03-23 01:49:27 -04:00
1 parent 3f60365cc6
commit 61b1d6d869
3 files changed
+13

No files matched your search

+3
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,