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