chore: update version and enhance provider model configurations.

This commit is contained in:
decolua
2026-02-22 11:30:43 +07:00
parent ea67742f2a
commit 930e917092
7 changed files with 46 additions and 53 deletions
+15 -7
View File
@@ -2,6 +2,11 @@ import { cleanupProviderConnections, getSettings } from "@/lib/localDb";
import { enableTunnel } from "@/lib/tunnel/tunnelManager";
import { killCloudflared, isCloudflaredRunning, ensureCloudflared } from "@/lib/tunnel/cloudflared";
// Multiple modules register SIGINT/SIGTERM handlers legitimately
process.setMaxListeners(20);
let signalHandlersRegistered = false;
/**
* Initialize app on startup
* - Cleanup stale data
@@ -24,13 +29,16 @@ export async function initializeApp() {
}
}
// Kill cloudflared on process exit
const cleanup = () => {
killCloudflared();
process.exit();
};
process.on("SIGINT", cleanup);
process.on("SIGTERM", cleanup);
// Kill cloudflared on process exit (register once only)
if (!signalHandlersRegistered) {
const cleanup = () => {
killCloudflared();
process.exit();
};
process.on("SIGINT", cleanup);
process.on("SIGTERM", cleanup);
signalHandlersRegistered = true;
}
// Pre-download cloudflared binary in background
ensureCloudflared().catch(() => {});