feat: 语音确认、联调与运维增强
- 语音:序数解析(第一个/第二个等)、解析失败计数与 API detail.retry_remaining; 百度 ASR 固定 dev_pid 为普通话;SurgeryPipelineError 支持 extra 并入 HTTP detail。 - Demo:demo 路由与假 RTSP、客户端 index 与 README;BackendResolver 与配置调整。 - 可观测:消耗 TSV 日志、语音文件日志、终端 Markdown 辅助;相关测试与依赖更新。 - 注意:.env 仍被 gitignore,本地密钥不会进入本提交。 Made-with: Cursor
This commit is contained in:
41
start_fresh.sh
Executable file
41
start_fresh.sh
Executable file
@@ -0,0 +1,41 @@
|
||||
#!/usr/bin/env bash
|
||||
# 与 start.sh 相同,唯一额外步骤:在启动 API 前清空本应用业务表(见 scripts/start_fresh.py)。
|
||||
# 用法与 start 一致: SKIP_DOCKER=1、COMPOSE_FILE、PORT 等,参见 start.sh
|
||||
#
|
||||
# 仅清空库、不启动服务: uv run python scripts/start_fresh.py
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
cd "$ROOT"
|
||||
|
||||
COMPOSE_FILE="${COMPOSE_FILE:-docker-compose.dev.yml}"
|
||||
|
||||
if [[ "${SKIP_DOCKER:-0}" != "1" ]]; then
|
||||
echo "Starting Docker Compose services: db, minio ($COMPOSE_FILE)"
|
||||
docker compose -f "$COMPOSE_FILE" up -d db minio
|
||||
echo "MinIO API: http://127.0.0.1:${MINIO_PORT:-9000} console: http://127.0.0.1:${MINIO_CONSOLE_PORT:-9001}"
|
||||
echo "Waiting for PostgreSQL..."
|
||||
for _ in $(seq 1 60); do
|
||||
if docker compose -f "$COMPOSE_FILE" exec -T db \
|
||||
pg_isready -U "${POSTGRES_USER:-postgres}" -d "${POSTGRES_DB:-operation_room}" \
|
||||
>/dev/null 2>&1; then
|
||||
echo "PostgreSQL is ready."
|
||||
break
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
else
|
||||
echo "SKIP_DOCKER=1: not starting Docker Compose; using POSTGRES_* or DATABASE_URL from the environment."
|
||||
fi
|
||||
|
||||
export POSTGRES_USER="${POSTGRES_USER:-postgres}"
|
||||
export POSTGRES_PASSWORD="${POSTGRES_PASSWORD:-postgres}"
|
||||
export POSTGRES_DB="${POSTGRES_DB:-operation_room}"
|
||||
export POSTGRES_HOST="${POSTGRES_HOST:-localhost}"
|
||||
export POSTGRES_PORT="${POSTGRES_PORT:-35432}"
|
||||
|
||||
echo "start_fresh: clearing app tables (TRUNCATE)..."
|
||||
uv run python scripts/start_fresh.py
|
||||
|
||||
exec uv run uvicorn main:app --host "${HOST:-0.0.0.0}" --port "${PORT:-38080}" --reload
|
||||
Reference in New Issue
Block a user