diff --git a/services/appflowy-collaborate/src/group/broadcast.rs b/services/appflowy-collaborate/src/group/broadcast.rs index 13136a3f..8b4b379f 100644 --- a/services/appflowy-collaborate/src/group/broadcast.rs +++ b/services/appflowy-collaborate/src/group/broadcast.rs @@ -523,7 +523,9 @@ impl Subscription { } if let Some(stream_stop_tx) = self.stream_stop_tx.take() { if let Err(err) = stream_stop_tx.send(()).await { - warn!("the stream might be already stop, error: {}", err); + if cfg!(debug_assertions) { + warn!("the stream might be already stop, error: {}", err); + } } } } diff --git a/services/appflowy-collaborate/src/group/group_init.rs b/services/appflowy-collaborate/src/group/group_init.rs index 9252add5..2bc58c98 100644 --- a/services/appflowy-collaborate/src/group/group_init.rs +++ b/services/appflowy-collaborate/src/group/group_init.rs @@ -11,7 +11,7 @@ use collab_entity::CollabType; use dashmap::DashMap; use futures_util::{SinkExt, StreamExt}; use tokio::sync::{mpsc, RwLock}; -use tracing::{error, event, info, trace}; +use tracing::{error, event, trace}; use yrs::updates::decoder::Decode; use yrs::updates::encoder::Encode; use yrs::Update; @@ -200,24 +200,7 @@ impl CollabGroup { modified_at.elapsed().as_secs() > 60 * 60 } else { let elapsed_secs = modified_at.elapsed().as_secs(); - if elapsed_secs > self.timeout_secs() { - // Mark the group as inactive if it has been inactive for more than 3 hours, even if there are subscribers. - // Otherwise, return true only if there are no subscribers. - const MAXIMUM_SECS: u64 = 3 * 60 * 60; - if elapsed_secs > MAXIMUM_SECS { - info!( - "Group:{} is inactive for {} seconds, subscribers: {}", - self.object_id, - modified_at.elapsed().as_secs(), - self.subscribers.len() - ); - true - } else { - self.subscribers.is_empty() - } - } else { - false - } + elapsed_secs > self.timeout_secs() && self.subscribers.is_empty() } }