mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Update to Python3.11
This commit is contained in:
parent
291822b5c8
commit
d6ba45a42b
@ -6,7 +6,7 @@ runs:
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: "3.10"
|
||||
python-version: "3.11"
|
||||
cache: pip
|
||||
|
||||
- name: Install environment
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
from asyncio import wait
|
||||
from asyncio import wait, create_task
|
||||
|
||||
from fastapi import APIRouter, WebSocket
|
||||
from fastapi.encoders import jsonable_encoder
|
||||
@ -17,7 +17,7 @@ class ConnectionManager:
|
||||
async def shutdown(self) -> None:
|
||||
futures = []
|
||||
for connection in self.active_connections:
|
||||
futures.append(connection.close())
|
||||
futures.append(create_task(connection.close()))
|
||||
await wait(futures)
|
||||
|
||||
async def connect(self, websocket: WebSocket) -> None:
|
||||
@ -30,7 +30,7 @@ class ConnectionManager:
|
||||
async def broadcast(self, events: GameUpdateEventsJs) -> None:
|
||||
futures = []
|
||||
for connection in self.active_connections:
|
||||
futures.append(connection.send_json(jsonable_encoder(events)))
|
||||
futures.append(create_task(connection.send_json(jsonable_encoder(events))))
|
||||
await wait(futures)
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user