Skip to content

Commit

Permalink
update: refresh timeout greater than idle timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
HolgerHuo committed Jan 8, 2025
1 parent 729e237 commit b945af4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/service/presence/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ impl Service {
/// Pings the presence of the given user in the given room, setting the
/// specified state.
pub async fn ping_presence(&self, user_id: &UserId, new_state: &PresenceState) -> Result<()> {
const REFRESH_TIMEOUT: u64 = 60 * 25 * 1000;
const REFRESH_TIMEOUT: u64 = 1 * 60 * 1000;

let last_presence = self.db.get_presence(user_id).await;
let state_changed = match last_presence {
Expand All @@ -109,7 +109,7 @@ impl Service {
presence.content.last_active_ago.unwrap_or_default().into(),
};

if !state_changed && last_last_active_ago < REFRESH_TIMEOUT {
if !state_changed && last_last_active_ago < refresh_timeout {
return Ok(());
}

Expand Down

0 comments on commit b945af4

Please sign in to comment.