mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Fix flight-plans no longer being highlighted
Bug introduced as part of the upgrade to Python 3.11?
This commit is contained in:
parent
f76fe6eeec
commit
09ddc3c3c6
@ -1,4 +1,4 @@
|
|||||||
from asyncio import wait
|
from asyncio import wait, tasks
|
||||||
|
|
||||||
from fastapi import APIRouter, WebSocket
|
from fastapi import APIRouter, WebSocket
|
||||||
from fastapi.encoders import jsonable_encoder
|
from fastapi.encoders import jsonable_encoder
|
||||||
@ -17,8 +17,8 @@ class ConnectionManager:
|
|||||||
async def shutdown(self) -> None:
|
async def shutdown(self) -> None:
|
||||||
futures = []
|
futures = []
|
||||||
for connection in self.active_connections:
|
for connection in self.active_connections:
|
||||||
futures.append(connection.close())
|
futures.append(tasks.create_task(connection.close()))
|
||||||
await wait(futures) # type: ignore
|
await wait(futures)
|
||||||
|
|
||||||
async def connect(self, websocket: WebSocket) -> None:
|
async def connect(self, websocket: WebSocket) -> None:
|
||||||
await websocket.accept()
|
await websocket.accept()
|
||||||
@ -30,8 +30,10 @@ class ConnectionManager:
|
|||||||
async def broadcast(self, events: GameUpdateEventsJs) -> None:
|
async def broadcast(self, events: GameUpdateEventsJs) -> None:
|
||||||
futures = []
|
futures = []
|
||||||
for connection in self.active_connections:
|
for connection in self.active_connections:
|
||||||
futures.append(connection.send_json(jsonable_encoder(events)))
|
futures.append(
|
||||||
await wait(futures) # type: ignore
|
tasks.create_task(connection.send_json(jsonable_encoder(events)))
|
||||||
|
)
|
||||||
|
await wait(futures)
|
||||||
|
|
||||||
|
|
||||||
manager = ConnectionManager()
|
manager = ConnectionManager()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user