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:
oliver 2026-08-02 18:20:13 +08:00
parent 96be90bd1a
commit f1263b0848
6 changed files with 135 additions and 16 deletions

View file

@ -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"