- ReformatPanel: compile tab state machine (idle/loading/success/error) - Blob URL for PDF preview; backend path hidden - First-compile 1-3min hint banner (dismissible) - QUEUE_FULL 429 with fixed message - Store: compileStatus/compileResult/compileError + actions - prewarm_tectonic.sh: minimal .tex compilation to pre-cache TeX bundles - Vitest: 6 new cases (guide / button / loading / success / error / queue-full)
37 lines
1.5 KiB
Bash
Executable File
37 lines
1.5 KiB
Bash
Executable File
#!/usr/bin/env bash
|
||
# restart.sh —— REVIEW 服务重启脚本(8100;不触碰生产服务 8090/8091/8092/8093/8094/8097/8098)。
|
||
# 用法: restart.sh [python] [port]
|
||
set -euo pipefail
|
||
|
||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||
# 默认 venv:本机统一 venv 固定路径(原先 $REPO_ROOT/../ 推导在本工作区不存在)
|
||
PYTHON="${1:-/home/xzq/5090/teamWorkspace/zh/plantai-rag-new-venv/bin/python}"
|
||
PORT="${2:-8100}"
|
||
HOST="${REVIEW_BIND_HOST:-127.0.0.1}"
|
||
|
||
[[ -x "$PYTHON" ]] || { echo "Python not found: $PYTHON" >&2; exit 2; }
|
||
|
||
APP_MODULE="app.main:app"
|
||
if command -v lsof >/dev/null 2>&1; then
|
||
PID="$(lsof -ti tcp:"$PORT" -sTCP:LISTEN 2>/dev/null || true)"
|
||
if [[ -n "$PID" ]]; then
|
||
echo "[restart] 停止 $PORT 旧进程 pid=$PID"
|
||
kill $PID 2>/dev/null || true
|
||
sleep 2
|
||
fi
|
||
fi
|
||
|
||
cd "$SCRIPT_DIR"
|
||
# 加载运行时配置(.env 不入 git):services/llm.py 直接读 REVIEW_LLM_*/DOCGEN_LLM_*
|
||
# 裸键,paper_parse.py 读 REVIEW_*——需 set -a 显式导出(同 paper_writer_service 先例)。
|
||
set -a
|
||
[ -f .env ] && source .env
|
||
set +a
|
||
echo "[restart] 启动审稿服务 :$PORT($PYTHON)"
|
||
nohup "$PYTHON" -m uvicorn "$APP_MODULE" --host "$HOST" --port "$PORT" \
|
||
> "$SCRIPT_DIR/review.log" 2>&1 &
|
||
# P3b:后台预热 tectonic TeX bundle(非阻塞;仅首次需 1-3 分钟,失败不影响服务)
|
||
nohup bash "$SCRIPT_DIR/scripts/prewarm_tectonic.sh" \
|
||
> "$SCRIPT_DIR/prewarm.log" 2>&1 &
|
||
echo "[restart] 完成;日志 review_service/review.log(预热 prewarm.log)"
|