(signal: string)
| 1170 | console.log('[browse] Supervisor mode: monitoring server. Ctrl-C to stop.'); |
| 1171 | let supervisorExiting = false; |
| 1172 | const teardownAndExit = (signal: string) => { |
| 1173 | if (supervisorExiting) return; |
| 1174 | supervisorExiting = true; |
| 1175 | console.log(`\n[browse] ${signal} received — stopping server.`); |
| 1176 | const state = readState(); |
| 1177 | if (state?.pid && isProcessAlive(state.pid)) { |
| 1178 | safeKill(state.pid, 'SIGTERM'); |
| 1179 | } |
| 1180 | process.exit(0); |
| 1181 | }; |
| 1182 | process.on('SIGINT', () => teardownAndExit('SIGINT')); |
| 1183 | process.on('SIGTERM', () => teardownAndExit('SIGTERM')); |
| 1184 |
no test coverage detected