@elyun/bylane 1.25.0 → 1.26.0
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/src/cli.js +14 -8
package/package.json
CHANGED
package/src/cli.js
CHANGED
|
@@ -270,15 +270,21 @@ if (command === 'install') {
|
|
|
270
270
|
const state = readState(loopName)
|
|
271
271
|
if (!state?.pid) continue
|
|
272
272
|
const pid = Number(state.pid)
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
273
|
+
let alive = false
|
|
274
|
+
try { process.kill(pid, 0); alive = true } catch {}
|
|
275
|
+
|
|
276
|
+
if (alive) {
|
|
277
|
+
try {
|
|
278
|
+
process.kill(pid, 'SIGTERM')
|
|
279
|
+
console.log(` ${loopName} (PID: ${pid}) 종료`)
|
|
280
|
+
} catch {
|
|
281
|
+
console.log(` ${loopName} (PID: ${pid}) 종료 실패`)
|
|
282
|
+
}
|
|
283
|
+
} else {
|
|
284
|
+
console.log(` ${loopName} (PID: ${pid}) 이미 종료됨 — 상태 정리`)
|
|
281
285
|
}
|
|
286
|
+
writeState(loopName, { ...state, status: 'stopped', stoppedAt: new Date().toISOString() })
|
|
287
|
+
stopped = true
|
|
282
288
|
}
|
|
283
289
|
|
|
284
290
|
if (!stopped) {
|