Reapply "Merge pull request #686 from AnishSarkar22/feat/replace-logs"

This reverts commit 3418c0e026.
This commit is contained in:
DESKTOP-RTLN3BA\$punk 2026-01-16 11:32:06 -08:00
parent 3418c0e026
commit 8aad15d392
84 changed files with 8266 additions and 4613 deletions

View file

@ -11,6 +11,26 @@ cleanup() {
trap cleanup SIGTERM SIGINT
# Run database migrations with safeguards
echo "Running database migrations..."
# Wait for database to be ready (max 30 seconds)
for i in {1..30}; do
if python -c "from app.db import engine; import asyncio; asyncio.run(engine.dispose())" 2>/dev/null; then
echo "Database is ready."
break
fi
echo "Waiting for database... ($i/30)"
sleep 1
done
# Run migrations with timeout (60 seconds max)
if timeout 60 alembic upgrade head 2>&1; then
echo "Migrations completed successfully."
else
echo "WARNING: Migration failed or timed out. Continuing anyway..."
echo "You may need to run migrations manually: alembic upgrade head"
fi
echo "Starting FastAPI Backend..."
python main.py &
backend_pid=$!