summary refs log tree commit diff
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2026-02-27 11:03:55 +0100
committerRory& <root@rory.gay>2026-02-27 11:10:10 +0100
commit5b47b66a1909fc989a52f33c7c0e369b333dd6a9 (patch)
treeeabf16eb1fde42db1f6f3da3261a3df5687223e8
parentOption to disable logging route registrations (diff)
downloadserver-ts-5b47b66a1909fc989a52f33c7c0e369b333dd6a9.tar.xz
IPC: factor out imports
-rw-r--r--src/util/util/Event.ts10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/util/util/Event.ts b/src/util/util/Event.ts

index 27b1986e..c2ce1a27 100644 --- a/src/util/util/Event.ts +++ b/src/util/util/Event.ts
@@ -26,6 +26,10 @@ import { Socket } from "node:net"; import { FSWatcher } from "node:fs"; import { Stopwatch } from "./Stopwatch"; import { Config } from "./Config"; +import net from "net"; +import fs from "fs"; +import { red } from "picocolors"; + export const events = new EventEmitter(); let unixSocketListener: UnixSocketListener | null = null; let unixSocketWriter: UnixSocketWriter | null = null; @@ -227,9 +231,6 @@ class UnixSocketListener { } async init() { - const net = await import("net"); - const fs = await import("fs"); - // remove stale socket file if it exists // can happen if there's a PID conflict (across containers/PID namespaces) try { @@ -322,9 +323,6 @@ class UnixSocketWriter { } async init() { - const net = await import("net"); - const fs = await import("fs"); - if (!fs.opendirSync(this.socketPath)) throw new Error("Unix socket path does not exist or is not a directory: " + this.socketPath); console.log("[Events] Unix socket writer initializing for", this.socketPath);