mirror of
https://github.com/hansjone/netx.git
synced 2026-10-09 00:50:46 +08:00
Start API and collector worker together from one-click scripts.
Default start_netx.ps1/sh now set NETX_RUN_INLINE_SCHEDULERS=false and launch netx_api.worker; stop scripts tear the worker down with the API. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
96be90bd1a
commit
f1263b0848
6 changed files with 135 additions and 16 deletions
|
|
@ -20,6 +20,7 @@ ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|||
RUN_DIR="${ROOT_DIR}/scripts/.run"
|
||||
|
||||
PID_FILE="${RUN_DIR}/netx.pid"
|
||||
WORKER_PID_FILE="${RUN_DIR}/worker.pid"
|
||||
WEB_PID_FILE="${RUN_DIR}/web.pid"
|
||||
|
||||
API_PORT="8890"
|
||||
|
|
@ -93,6 +94,14 @@ else
|
|||
echo "[INFO] No API PID file: ${PID_FILE}"
|
||||
fi
|
||||
|
||||
if [[ -f "${WORKER_PID_FILE}" ]]; then
|
||||
WORKER_PID="$(head -n 1 "${WORKER_PID_FILE}" | tr -d '[:space:]' || true)"
|
||||
kill_pid "${WORKER_PID}" "worker"
|
||||
rm -f "${WORKER_PID_FILE}" || true
|
||||
else
|
||||
echo "[INFO] No worker PID file: ${WORKER_PID_FILE}"
|
||||
fi
|
||||
|
||||
if [[ -f "${WEB_PID_FILE}" ]]; then
|
||||
WEB_PID="$(head -n 1 "${WEB_PID_FILE}" | tr -d '[:space:]' || true)"
|
||||
kill_pid "${WEB_PID}" "web"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue