chore: initialize before lock collab

This commit is contained in:
nathan 2024-08-22 23:26:20 +08:00
parent 1a053172c2
commit 12a1539f32
1 changed files with 2 additions and 6 deletions

View File

@ -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)
};