Scale biz_state collects with dedicated workers and non-blocking UI poll.

Add PG claim/NE mutex, persist pool, and biz_state_worker replicas; fix double-SSH and row-count bugs; stop 32m collectNow while-loop from freezing page switches.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
oliver 2026-09-22 17:00:37 +08:00
parent 0eb65a839e
commit 3a0de0d7fb
22 changed files with 1210 additions and 165 deletions

View file

@ -102,6 +102,16 @@ else
echo "[INFO] No worker PID file: ${WORKER_PID_FILE}"
fi
BIZ_DIR="${RUN_DIR}/biz_state_workers"
if [[ -d "${BIZ_DIR}" ]]; then
for f in "${BIZ_DIR}"/*.pid; do
[[ -f "${f}" ]] || continue
BPID="$(head -n 1 "${f}" | tr -d '[:space:]' || true)"
kill_pid "${BPID}" "biz_state_worker"
rm -f "${f}" || true
done
fi
if [[ -f "${WEB_PID_FILE}" ]]; then
WEB_PID="$(head -n 1 "${WEB_PID_FILE}" | tr -d '[:space:]' || true)"
kill_pid "${WEB_PID}" "web"