2026-04-09 11:54:30 +08:00
|
|
|
|
#!/usr/bin/env bash
|
2026-04-10 10:30:01 +08:00
|
|
|
|
# 启动 Fish API(uvicorn),不执行 prestart_fresh,保留 SQLite 与 measure/action 缓存。
|
2026-04-09 11:54:30 +08:00
|
|
|
|
#
|
2026-04-10 10:30:01 +08:00
|
|
|
|
# bash fish_api/start_no_fresh.sh
|
|
|
|
|
|
# PORT=8001 HOST=0.0.0.0 bash fish_api/start_no_fresh.sh
|
2026-04-09 11:54:30 +08:00
|
|
|
|
#
|
|
|
|
|
|
# 首次使用请先:cd fish_api && uv sync
|
|
|
|
|
|
#
|
|
|
|
|
|
set -euo pipefail
|
|
|
|
|
|
|
|
|
|
|
|
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
|
|
|
|
cd "$DIR"
|
|
|
|
|
|
|
2026-04-10 18:16:15 +08:00
|
|
|
|
# 勿在此默认导出 PUBLIC_BASE_URL:shell 环境会覆盖 fish_api/.env(pydantic 优先级)。
|
|
|
|
|
|
# 未设置时由 app/settings.py 的默认值或 .env 中的 PUBLIC_BASE_URL 决定。
|
2026-04-09 11:54:30 +08:00
|
|
|
|
unset PYTHON_FISH_MEASURE PYTHON_FISH_ACTION 2>/dev/null || true
|
|
|
|
|
|
|
|
|
|
|
|
PORT="${PORT:-8000}"
|
|
|
|
|
|
HOST="${HOST:-0.0.0.0}"
|
|
|
|
|
|
|
|
|
|
|
|
if command -v uv >/dev/null 2>&1; then
|
|
|
|
|
|
exec uv run uvicorn app.main:app --host "$HOST" --port "$PORT"
|
|
|
|
|
|
else
|
|
|
|
|
|
exec uvicorn app.main:app --host "$HOST" --port "$PORT"
|
|
|
|
|
|
fi
|