tune(friends): shorten presence auto-refresh 60s -> 15s
The 60s cadence predated the self-heal fix. 15s keeps the friends list tracking online/in-room/offline changes more closely; each pass is still just one short connection per friend, so the cost is small at typical friend-list sizes. The manual Rescan button covers anything faster. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+6
-4
@@ -966,10 +966,12 @@ async fn persist_and_emit_friends(
|
||||
.await;
|
||||
}
|
||||
|
||||
/// How often the outbound presence scheduler refreshes friends' status. Slow on
|
||||
/// purpose — presence is best-effort, not real-time, and each pass opens a short
|
||||
/// connection per friend.
|
||||
const PING_INTERVAL: Duration = Duration::from_secs(60);
|
||||
/// How often the outbound presence scheduler refreshes friends' status. Each pass
|
||||
/// opens one short connection per friend with a saved address, so the cost scales
|
||||
/// with friend-count, not a fixed per-tick cost. 15s keeps the list feeling live
|
||||
/// without aggressively probing peers for a best-effort signal; the manual Rescan
|
||||
/// button covers the "update now" case below this interval.
|
||||
const PING_INTERVAL: Duration = Duration::from_secs(15);
|
||||
/// Delay before the FIRST presence pass, so the endpoint's background `online()`
|
||||
/// has a moment to finish (otherwise the first probes fail and friends flash offline).
|
||||
const PING_STARTUP_DELAY: Duration = Duration::from_secs(3);
|
||||
|
||||
Reference in New Issue
Block a user