()
| 822 | |
| 823 | for (const signal of signals) { |
| 824 | const handler = (): void => { |
| 825 | if (signal === 'SIGHUP') { |
| 826 | this.emergencyTerminalExit(); |
| 827 | return; |
| 828 | } |
| 829 | // Registering a SIGTERM listener disables Node's default exit(143), |
| 830 | // so we must reinstate it after stop() or on failure. |
| 831 | this.stop(143).then( |
| 832 | () => { |
| 833 | process.exit(143); |
| 834 | }, |
| 835 | () => { |
| 836 | this.emergencyTerminalExit(143); |
| 837 | }, |
| 838 | ); |
| 839 | }; |
| 840 | process.prependListener(signal, handler); |
| 841 | this.signalCleanupHandlers.push(() => { |
| 842 | process.off(signal, handler); |
nothing calls this directly
no test coverage detected