Write logs on SIGTERM and SIGINT

This commit is contained in:
Sander Declerck 2025-10-31 10:39:24 +01:00
parent 5eeb68e355
commit 088c215569
No known key found for this signature in database

View file

@ -8,6 +8,9 @@ import { createSafeChainProxy } from "./registryProxy/registryProxy.js";
import chalk from "chalk"; import chalk from "chalk";
export async function main(args) { export async function main(args) {
process.on("SIGINT", handleProcessTermination);
process.on("SIGTERM", handleProcessTermination);
const proxy = createSafeChainProxy(); const proxy = createSafeChainProxy();
await proxy.startServer(); await proxy.startServer();
@ -59,3 +62,7 @@ export async function main(args) {
await proxy.stopServer(); await proxy.stopServer();
} }
} }
function handleProcessTermination() {
ui.writeBufferedLogsAndStopBuffering();
}