Skip to content

Commit

Permalink
chore: enable lock timeout feature (#771)
Browse files Browse the repository at this point in the history
  • Loading branch information
appflowy authored Aug 30, 2024
1 parent 3e701a1 commit 1f9a03a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
12 changes: 6 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ percent-encoding = "2.3.1"
appflowy-ai-client = { workspace = true, features = ["dto", "client-api"] }
pgvector = { workspace = true, features = ["sqlx"] }

collab = { workspace = true }
collab = { workspace = true, features = ["lock_timeout"] }
collab-document = { workspace = true }
collab-entity = { workspace = true }
collab-folder = { workspace = true }
Expand Down Expand Up @@ -285,12 +285,12 @@ debug = true
[patch.crates-io]
# It's diffcult to resovle different version with the same crate used in AppFlowy Frontend and the Client-API crate.
# So using patch to workaround this issue.
collab = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "5a1e94d60eea2c8612b2895dbbbdd6e5d5f03d97" }
collab-entity = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "5a1e94d60eea2c8612b2895dbbbdd6e5d5f03d97" }
collab-folder = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "5a1e94d60eea2c8612b2895dbbbdd6e5d5f03d97" }
collab-document = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "5a1e94d60eea2c8612b2895dbbbdd6e5d5f03d97" }
collab-user = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "5a1e94d60eea2c8612b2895dbbbdd6e5d5f03d97" }
collab-database = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "5a1e94d60eea2c8612b2895dbbbdd6e5d5f03d97" }
collab = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "47dbd6c8033f8fd2999cb8d11f2d60ede121a0ac" }
collab-entity = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "47dbd6c8033f8fd2999cb8d11f2d60ede121a0ac" }
collab-folder = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "47dbd6c8033f8fd2999cb8d11f2d60ede121a0ac" }
collab-document = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "47dbd6c8033f8fd2999cb8d11f2d60ede121a0ac" }
collab-user = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "47dbd6c8033f8fd2999cb8d11f2d60ede121a0ac" }
collab-database = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "47dbd6c8033f8fd2999cb8d11f2d60ede121a0ac" }

[features]
history = []
Expand Down
5 changes: 3 additions & 2 deletions services/appflowy-collaborate/src/group/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use dashmap::mapref::one::RefMut;
use dashmap::try_result::TryResult;
use dashmap::DashMap;
use tokio::time::sleep;
use tracing::{error, event, warn};
use tracing::{error, event, info, warn};

use collab_rt_entity::user::RealtimeUser;

Expand Down Expand Up @@ -39,12 +39,13 @@ impl GroupManagementState {
let (object_id, group) = (entry.key(), entry.value());
if group.is_inactive().await {
inactive_group_ids.push(object_id.clone());
if inactive_group_ids.len() > 5 {
if inactive_group_ids.len() > 10 {
break;
}
}
}

info!("Remove inactive group ids: {:?}", inactive_group_ids);
for object_id in &inactive_group_ids {
self.remove_group(object_id).await;
}
Expand Down

0 comments on commit 1f9a03a

Please sign in to comment.