mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 12:10:49 +00:00
Write logs on SIGTERM and SIGINT
This commit is contained in:
parent
5eeb68e355
commit
088c215569
1 changed files with 7 additions and 0 deletions
|
|
@ -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();
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue