(msg: string)
| 33 | } |
| 34 | |
| 35 | const sendToSystemd = (msg: string): void => { |
| 36 | const buffer = Buffer.from(msg); |
| 37 | |
| 38 | // biome-ignore lint/style/noNonNullAssertion: valid from start of function |
| 39 | socket.send(buffer, 0, buffer.byteLength, process.env.NOTIFY_SOCKET!, (err) => { |
| 40 | if (err) { |
| 41 | logger.warning(`Failed to send "${msg}" to systemd: ${err.message}`); |
| 42 | } |
| 43 | }); |
| 44 | }; |
| 45 | const notifyStopping = (): void => sendToSystemd("STOPPING=1"); |
| 46 | |
| 47 | sendToSystemd("READY=1"); |
no test coverage detected