From 12a1539f327031eb017acfbfdbcd4a29a7c89173 Mon Sep 17 00:00:00 2001 From: nathan Date: Thu, 22 Aug 2024 23:26:20 +0800 Subject: [PATCH] chore: initialize before lock collab --- services/appflowy-collaborate/src/group/manager.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/services/appflowy-collaborate/src/group/manager.rs b/services/appflowy-collaborate/src/group/manager.rs index 7a5a9001..caff7878 100644 --- a/services/appflowy-collaborate/src/group/manager.rs +++ b/services/appflowy-collaborate/src/group/manager.rs @@ -178,7 +178,7 @@ where let result = load_collab(user.uid, object_id, params, self.storage.clone()).await; let (collab, encode_collab) = { - let (collab, encode_collab) = match result { + let (mut collab, encode_collab) = match result { Ok(value) => value, Err(err) => { if err.is_record_not_found() { @@ -194,12 +194,8 @@ where }, }; + collab.initialize(); let collab = Arc::new(RwLock::new(collab)); - { - // initialize - let mut collab = collab.write().await; - collab.initialize(); - } (collab, encode_collab) };