triflux 8.9.0 → 8.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/scripts/hub-ensure.mjs +29 -10
package/package.json
CHANGED
package/scripts/hub-ensure.mjs
CHANGED
|
@@ -66,13 +66,25 @@ function startHubDetached(port) {
|
|
|
66
66
|
if (!existsSync(serverPath)) return false;
|
|
67
67
|
|
|
68
68
|
try {
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
69
|
+
const env = { ...process.env, TFX_HUB_PORT: String(port) };
|
|
70
|
+
if (process.platform === "win32") {
|
|
71
|
+
// Windows: cmd.exe /c start /b → 완전 독립 프로세스 트리 생성
|
|
72
|
+
// hook timeout 시 프로세스 트리 킬에서 살아남음
|
|
73
|
+
const child = spawn("cmd.exe", ["/c", "start", "/b", "", process.execPath, serverPath], {
|
|
74
|
+
env,
|
|
75
|
+
detached: true,
|
|
76
|
+
stdio: "ignore",
|
|
77
|
+
windowsHide: true,
|
|
78
|
+
});
|
|
79
|
+
child.unref();
|
|
80
|
+
} else {
|
|
81
|
+
const child = spawn(process.execPath, [serverPath], {
|
|
82
|
+
env,
|
|
83
|
+
detached: true,
|
|
84
|
+
stdio: "ignore",
|
|
85
|
+
});
|
|
86
|
+
child.unref();
|
|
87
|
+
}
|
|
76
88
|
return true;
|
|
77
89
|
} catch {
|
|
78
90
|
return false;
|
|
@@ -94,9 +106,16 @@ const { host, port } = resolveHubTarget();
|
|
|
94
106
|
if (!(await isHubHealthy(host, port))) {
|
|
95
107
|
const started = startHubDetached(port);
|
|
96
108
|
if (started) {
|
|
97
|
-
const ready = await waitForHubReady(host, port);
|
|
98
|
-
if (
|
|
99
|
-
|
|
109
|
+
const ready = await waitForHubReady(host, port, 3000);
|
|
110
|
+
if (ready) {
|
|
111
|
+
process.stdout.write("hub: ok");
|
|
112
|
+
} else {
|
|
113
|
+
// fire-and-forget: hub이 아직 기동 중일 수 있음 — 에러가 아닌 경고
|
|
114
|
+
process.stdout.write("hub: starting");
|
|
100
115
|
}
|
|
116
|
+
} else {
|
|
117
|
+
process.stderr.write("[hub-ensure] hub 시작 실패");
|
|
101
118
|
}
|
|
119
|
+
} else {
|
|
120
|
+
process.stdout.write("hub: ok");
|
|
102
121
|
}
|