mirror of
https://github.com/microsoft/playwright-mcp.git
synced 2025-07-26 08:32:26 +08:00
fix: exit watchdog should listen for SIGINT/SIGTERM (#144)
This commit is contained in:
parent
b8ff009b0a
commit
31ac1ed191
@ -100,11 +100,15 @@ program
|
||||
});
|
||||
|
||||
function setupExitWatchdog(serverList: ServerList) {
|
||||
process.stdin.on('close', async () => {
|
||||
const handleExit = async () => {
|
||||
setTimeout(() => process.exit(0), 15000);
|
||||
await serverList.closeAll();
|
||||
process.exit(0);
|
||||
});
|
||||
};
|
||||
|
||||
process.stdin.on('close', handleExit);
|
||||
process.on('SIGINT', handleExit);
|
||||
process.on('SIGTERM', handleExit);
|
||||
}
|
||||
|
||||
program.parse(process.argv);
|
||||
|
Loading…
x
Reference in New Issue
Block a user