feat: enhance IRC lobby management with reconnect handling and health check integration
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user