fix(shipping-process-gates): 收口技术重试并补齐运维 UI

跨 Job 累计技术失败次数,耗尽后将 Attempt/Gate 置为 failed_terminal;
收缩旧 action_buttons;healthcheck 增加 Worker 领取探针;恢复卡展示责任方与审计,Admin 诊断改主从布局。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
hugoandCursor committed 2026-08-01 13:54:14 +08:00
1 parent 323928626b
commit cef3d5b26a
15 files changed
+489 -150

No files matched your search

+36
View File
@@ -98,5 +98,41 @@ if [[ "${handler_check}" != "ok" ]]; then
fi
echo "Process Gate job handler OK."
# [STEP] 真实领取:入队探针 Job,等待 shipping-worker 将其推进到终态。
probe_check=$("${DC_CMD[@]}" "${compose_args[@]}" exec -T hxops-backend \
python - <<'PY' 2>/dev/null || true
import time
from app import create_app, db
from app.models import Job
from app.services.shipping_notice.process_gate_job_service import enqueue_process_gate_healthcheck_probe
app = create_app()
with app.app_context():
job_id = enqueue_process_gate_healthcheck_probe()
deadline = time.time() + 45
while time.time() < deadline:
db.session.expire_all()
job = db.session.get(Job, int(job_id))
if job is None:
print('missing_job')
raise SystemExit(0)
status = str(job.status or '')
if status in {'succeeded', 'failed', 'cancelled'}:
print('ok:' + status)
raise SystemExit(0)
if status == 'running':
# 已被 Worker 领取即视为通过(终态可能稍晚)。
print('ok:running')
raise SystemExit(0)
time.sleep(1.5)
print('timeout:queued')
PY
)
if [[ "${probe_check}" != ok:* ]]; then
echo "Healthcheck failed: Process Gate worker did not claim probe job (${probe_check:-empty})"
exit 1
fi
echo "Process Gate worker claim probe OK (${probe_check})."
echo "Healthcheck passed for ${ENV_NAME} environment."
exit 0