add: server stats page

This commit is contained in:
trisua 2025-05-02 20:51:19 -04:00
parent 98d6f21e6e
commit 07f5ebf8e7
8 changed files with 97 additions and 1 deletions

View file

@ -524,12 +524,14 @@ pub async fn handle_socket(socket: WebSocket, db: DataManager, user_id: String,
}
});
db.2.incr("atto.active_connections:user".to_string()).await;
tokio::select! {
_ = (&mut recv_task) => redis_task.abort(),
_ = (&mut redis_task) => recv_task.abort()
}
heartbeat_task.abort(); // kill
db.2.decr("atto.active_connections:user".to_string()).await;
tracing::info!("socket terminate");
}