MCPcopy
hub / github.com/Koenkk/zigbee2mqtt / sendToSystemd

Function sendToSystemd

lib/util/sd-notify.ts:35–44  ·  view source on GitHub ↗
(msg: string)

Source from the content-addressed store, hash-verified

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");

Callers 2

notifyStoppingFunction · 0.85
initSdNotifyFunction · 0.85

Calls 1

warningMethod · 0.80

Tested by

no test coverage detected