chore: обновить паузу занятия от main
# Conflicts: # backend/app/scoring/dispatcher.py # backend/app/session/store.py
This commit is contained in:
commit
0d58878cbe
51 changed files with 4545 additions and 87 deletions
|
|
@ -112,6 +112,7 @@ def _build_state(session_id: UUID, event, who, scenario, scenarios,
|
|||
dds_service=identity.service or event.dds_service,
|
||||
attempt=identity.attempt,
|
||||
criteria=event.criteria,
|
||||
socket_last_seen_at=now_utc(),
|
||||
)
|
||||
state.timers.limits[TimerCode.DDS_ACK] = event.criteria.decision_time_limit_seconds * 1000
|
||||
state.timers.limits[TimerCode.CARD_FILL] = event.criteria.card_fill_time_limit_seconds * 1000
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ from uuid import UUID
|
|||
from fastapi import APIRouter, WebSocket, WebSocketDisconnect
|
||||
from pydantic import TypeAdapter, ValidationError
|
||||
|
||||
from app.api.ws.session import pump, run_command, session_socket
|
||||
from app.api.ws.session import close_fenced, pump, run_command, session_socket
|
||||
from app.domain.events import (
|
||||
CallEndReason,
|
||||
ErrorEvent,
|
||||
|
|
@ -62,9 +62,14 @@ async def station(ws: WebSocket, session_id: UUID, role: str = "dds") -> None:
|
|||
entered = await session_socket(ws, session_id, (Role.INSTRUCTOR, Role.TRAINEE))
|
||||
if entered is None:
|
||||
return
|
||||
_who, state = entered
|
||||
who, state = entered
|
||||
|
||||
with hub.station(session_id) as queue:
|
||||
async with hub.trainee_socket(
|
||||
session_id, station=True, trainee=who.role is Role.TRAINEE,
|
||||
) as queue:
|
||||
if hub.is_lease_fenced(session_id):
|
||||
await close_fenced(ws)
|
||||
return
|
||||
sender = asyncio.create_task(pump(ws, queue))
|
||||
try:
|
||||
# Карточка, переданная до подключения станции, не теряется:
|
||||
|
|
|
|||
Loading…
Reference in a new issue