mirror of
https://github.com/xlorepdarkhelm/numinar-coding-project.git
synced 2026-09-09 16:19:50 -04:00
@@ -32,10 +32,8 @@ from backend.schemas.rooms import RoomUpdate
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
DEFAULT_TEST_MODE = (
|
||||
Query(False, description="Force immediate keep-alive for testing"),
|
||||
)
|
||||
DEFAULT_TIMEOUT = (Query(15.0, description="Keep-alive timeout in seconds"),)
|
||||
DEFAULT_TEST_MODE = False
|
||||
DEFAULT_TIMEOUT = 15.0
|
||||
|
||||
|
||||
router = APIRouter(prefix="/rooms", tags=["rooms"])
|
||||
@@ -85,8 +83,12 @@ async def publish_room_availability_event(event: dict[str, Any]) -> None:
|
||||
@router.get("/availability/stream")
|
||||
async def stream_room_availability(
|
||||
request: Request,
|
||||
test_mode: bool = DEFAULT_TEST_MODE, # type: ignore
|
||||
timeout: float = DEFAULT_TIMEOUT, # type: ignore
|
||||
test_mode: bool = Query( # noqa: B008
|
||||
DEFAULT_TEST_MODE, description="Force immediate keep-alive for testing"
|
||||
),
|
||||
timeout: float = Query( # noqa: B008
|
||||
DEFAULT_TIMEOUT, description="Keep-alive timeout in seconds"
|
||||
),
|
||||
) -> StreamingResponse:
|
||||
"""Stream real-time room availability changes using SSE.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user