feat: enhance IRC lobby management with reconnect handling and health check integration

This commit is contained in:
2026-02-28 20:50:57 +01:00
parent 307c41e4ea
commit 04d772d8ad
3 changed files with 250 additions and 18 deletions

View File

@@ -1,7 +1,7 @@
// src/routes/api/health/+server.ts
import { json } from '@sveltejs/kit';
import { db } from '$lib/server/db';
import { sql } from 'drizzle-orm';
import { isBanchoConnected, isBanchoReconnecting, getActiveLobbyCount } from '$lib/server/bancho/client';
import type { RequestHandler } from './$types';
export const GET: RequestHandler = async () => {
@@ -12,7 +12,13 @@ export const GET: RequestHandler = async () => {
return json({
status: 'ok',
timestamp: new Date().toISOString(),
uptime: process.uptime()
uptime: process.uptime(),
irc: {
connected: isBanchoConnected(),
reconnecting: isBanchoReconnecting(),
activeLobbies: getActiveLobbyCount(),
maxLobbies: 4
}
});
} catch (e: any) {
return json(