Skip to content

Commit

Permalink
chore: do not pull object when object ids is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
appflowy committed Dec 9, 2024
1 parent fb132cb commit 3fdd19f
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions frontend/rust-lib/flowy-database2/src/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -903,18 +903,21 @@ impl DatabaseCollabService for WorkspaceDatabaseCollabServiceImpl {
encoded_collab_by_id.insert(k, v);
}

// 2. Fetch remaining collabs from remote
let remote_collabs = self
.batch_get_encode_collab(object_ids, collab_type)
.await?;
if !object_ids.is_empty() {
// 2. Fetch remaining collabs from remote
let remote_collabs = self
.batch_get_encode_collab(object_ids, collab_type)
.await?;

trace!(
"[Database]: load {} database row from remote",
remote_collabs.len()
);
for (k, v) in remote_collabs {
encoded_collab_by_id.insert(k, v);
trace!(
"[Database]: load {} database row from remote",
remote_collabs.len()
);
for (k, v) in remote_collabs {
encoded_collab_by_id.insert(k, v);
}
}

Ok(encoded_collab_by_id)
}

Expand Down

0 comments on commit 3fdd19f

Please sign in to comment.