BUILD147 — обновление турнирной таблицы

This commit is contained in:
2026-09-18 18:46:36 +03:00
parent baca1e083c
commit a25c633a0b
4 changed files with 86 additions and 11 deletions

28
app.py
View File

@@ -29,7 +29,7 @@ from ui_builder import install_ui_builder
from khl_site.khl_data_center import APP as khl_site_app
BASE_DIR = Path(__file__).resolve().parent
BUILD_VERSION = "2026.09.18.4"
BUILD_VERSION = "2026.09.18.5"
# compatibility: BUILD_VERSION = "2026.08.26.1"
# compatibility: BUILD_VERSION = "2026.08.25.1"
# compatibility: BUILD_VERSION = "2026.08.24.15"
@@ -371,6 +371,32 @@ app.include_router(
agent_hub=hockey_agent_hub,
)
)
@app.post(
"/api/hockey/tournaments/{external_id}/standings/force-sync",
dependencies=[Depends(hockey_auth.require_user)],
tags=["Hockey"],
)
async def force_sync_tournament_standings(
external_id: str,
language: str = Query("ru", pattern="^(ru|en)$"),
game_id: str = Query("", max_length=64),
) -> dict[str, Any]:
"""Force a fresh Stat2TV standings download, bypassing the in-memory resource cache."""
if hockey_service.tournament(external_id, language=language) is None:
raise HTTPException(status_code=404, detail="Турнир не найден")
try:
return await hockey_service.sync_standings(
external_id,
language=language,
game_external_id=game_id,
force=True,
)
except ValueError as error:
raise HTTPException(status_code=400, detail=str(error)) from error
except Exception as error:
raise HTTPException(status_code=502, detail=str(error)) from error
app.include_router(create_hockey_auth_router(hockey_auth))
app.include_router(
create_hockey_agent_router(