fix: send socket pings every 30 seconds instead of 10

This commit is contained in:
trisua 2025-05-02 20:57:01 -04:00
parent 11b01b1b82
commit 052722eee8
3 changed files with 4 additions and 4 deletions

View file

@ -1,5 +1,5 @@
{% extends "root.html" %} {% block head %}
<title>Audit log - {{ config.name }}</title>
<title>Server stats - {{ config.name }}</title>
{% endblock %} {% block body %} {{ macros::nav() }}
<main class="flex flex-col gap-2">
<div class="card-nest w-full">
@ -21,7 +21,7 @@
</li>
<li>
<b>Socket threads:</b>
<b>Socket tasks:</b>
<span>{{ (active_users_chats + active_users) * 3 }}</span>
</li>
</ul>

View file

@ -507,7 +507,7 @@ pub async fn handle_socket(socket: WebSocket, db: DataManager, user_id: String,
let channel_c = channel.clone();
let heartbeat_task = tokio::spawn(async move {
let mut con = db2c.get_con().await;
let mut heartbeat = tokio::time::interval(Duration::from_secs(10));
let mut heartbeat = tokio::time::interval(Duration::from_secs(30));
loop {
con.publish::<&str, String, ()>(

View file

@ -241,7 +241,7 @@ pub async fn handle_socket(socket: WebSocket, db: DataManager, community_id: Str
let db2c = db.2.clone();
let heartbeat_task = tokio::spawn(async move {
let mut con = db2c.get_con().await;
let mut heartbeat = tokio::time::interval(Duration::from_secs(10));
let mut heartbeat = tokio::time::interval(Duration::from_secs(30));
loop {
con.publish::<usize, String, ()>(