Spaces:
Running
Running
Commit ·
aaec6a5
1
Parent(s): f260be9
Prints de diagnóstico en el boot (Space colgado en APP_STARTING)
Browse files
src/racing_reports/web/app.py
CHANGED
|
@@ -1,5 +1,7 @@
|
|
| 1 |
from __future__ import annotations
|
| 2 |
|
|
|
|
|
|
|
| 3 |
import json
|
| 4 |
import mimetypes
|
| 5 |
from datetime import date
|
|
@@ -11,6 +13,8 @@ from fastapi import FastAPI, Form, HTTPException, Request
|
|
| 11 |
from fastapi.responses import FileResponse, HTMLResponse, RedirectResponse
|
| 12 |
from fastapi.templating import Jinja2Templates
|
| 13 |
|
|
|
|
|
|
|
| 14 |
from racing_reports import vendor_env
|
| 15 |
from racing_reports.api import jobs as jobs_mod
|
| 16 |
from racing_reports.api.routes_jobs import router as api_jobs_router
|
|
@@ -24,6 +28,8 @@ from racing_reports.match_index import MatchIndex
|
|
| 24 |
from racing_reports.models import ReportRequest
|
| 25 |
from racing_reports.runner import ReportRunner
|
| 26 |
|
|
|
|
|
|
|
| 27 |
DEFAULT_LEAGUE = "Spanish Segunda Division"
|
| 28 |
DEFAULT_SEASON = "25-26"
|
| 29 |
REPORT_LABELS = {
|
|
@@ -296,6 +302,7 @@ def main() -> None:
|
|
| 296 |
import os
|
| 297 |
|
| 298 |
port = int(os.getenv("PORT", "7860"))
|
|
|
|
| 299 |
# forwarded_allow_ips="*" hace que uvicorn respete X-Forwarded-Proto del proxy
|
| 300 |
# de HF Spaces (termina TLS antes del container). Sin esto, request.url.scheme
|
| 301 |
# queda como "http" aunque el cliente llegue por HTTPS, y la cookie de auth se
|
|
|
|
| 1 |
from __future__ import annotations
|
| 2 |
|
| 3 |
+
print("[boot] web.app: arrancando imports", flush=True)
|
| 4 |
+
|
| 5 |
import json
|
| 6 |
import mimetypes
|
| 7 |
from datetime import date
|
|
|
|
| 13 |
from fastapi.responses import FileResponse, HTMLResponse, RedirectResponse
|
| 14 |
from fastapi.templating import Jinja2Templates
|
| 15 |
|
| 16 |
+
print("[boot] fastapi/uvicorn importados", flush=True)
|
| 17 |
+
|
| 18 |
from racing_reports import vendor_env
|
| 19 |
from racing_reports.api import jobs as jobs_mod
|
| 20 |
from racing_reports.api.routes_jobs import router as api_jobs_router
|
|
|
|
| 28 |
from racing_reports.models import ReportRequest
|
| 29 |
from racing_reports.runner import ReportRunner
|
| 30 |
|
| 31 |
+
print("[boot] módulos racing_reports importados", flush=True)
|
| 32 |
+
|
| 33 |
DEFAULT_LEAGUE = "Spanish Segunda Division"
|
| 34 |
DEFAULT_SEASON = "25-26"
|
| 35 |
REPORT_LABELS = {
|
|
|
|
| 302 |
import os
|
| 303 |
|
| 304 |
port = int(os.getenv("PORT", "7860"))
|
| 305 |
+
print(f"[boot] lanzando uvicorn en :{port}", flush=True)
|
| 306 |
# forwarded_allow_ips="*" hace que uvicorn respete X-Forwarded-Proto del proxy
|
| 307 |
# de HF Spaces (termina TLS antes del container). Sin esto, request.url.scheme
|
| 308 |
# queda como "http" aunque el cliente llegue por HTTPS, y la cookie de auth se
|