Skip to content

Commit a051da1

Browse files
refactor(server): acknowledge the desktop stop notice through a socket
Closing the ack pipe through a socket, like the stop pipe, drops the file-level node builtin lint suppression. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 734f4ba commit a051da1

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎apps/server/src/launcherWatch.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
// @effect-diagnostics nodeBuiltinImport:off -- closing an inherited pipe fd has no Effect API.
21
import * as NodeStream from "@effect/platform-node/NodeStream";
32
import * as Duration from "effect/Duration";
43
import * as Effect from "effect/Effect";
54
import * as Exit from "effect/Exit";
65
import * as Stream from "effect/Stream";
76
import * as HostProcess from "@t3tools/shared/HostProcess";
8-
import * as NodeFS from "node:fs";
97
import * as NodeNet from "node:net";
108

119
import { recordShutdownIntent } from "./shutdownIntent.ts";
@@ -83,7 +81,9 @@ export const awaitLauncherStopOnFds = (fds: { readonly stopFd: number; readonly
8381
closeOnDone: true,
8482
onError: (cause) => (cause instanceof Error ? cause : new Error(String(cause))),
8583
}),
86-
acknowledge: Effect.try(() => NodeFS.closeSync(fds.ackFd)).pipe(
84+
acknowledge: Effect.try(() =>
85+
new NodeNet.Socket({ fd: fds.ackFd, readable: false, writable: true }).destroy(),
86+
).pipe(
8787
Effect.catchCause((cause) =>
8888
Effect.logWarning("could not acknowledge the desktop stop notice", { cause }),
8989
),

0 commit comments

Comments
 (0)