From 11fd3b231a06268488e30ec6838f004e15cf633f Mon Sep 17 00:00:00 2001 From: Quentin Gliech Date: Fri, 12 Jul 2024 18:24:24 +0200 Subject: [PATCH] Don't hold the database connection for too long --- crates/tasks/src/matrix.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/tasks/src/matrix.rs b/crates/tasks/src/matrix.rs index d085236e..6f5229bf 100644 --- a/crates/tasks/src/matrix.rs +++ b/crates/tasks/src/matrix.rs @@ -225,8 +225,9 @@ async fn sync_devices( } } - // We now have a complete list of devices, so we can sync them with the - // homeserver + // We now have a complete list of devices, we can now release the connection and + // sync with the homeserver + repo.save().await?; let mxid = matrix.mxid(&user.username); matrix.sync_devices(&mxid, devices).await?;