Skip to content

Commit

Permalink
add typedef
Browse files Browse the repository at this point in the history
  • Loading branch information
zefanjajobse committed Nov 30, 2024
1 parent dac1323 commit cc5928c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions multialive/multialive.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,15 @@ async def gather_seeding(mainDb, group_id: str) -> dict[str, dict[str, str]]:

async def update_seeding(
mainDb, group_id: str, used_seeders: dict[str, dict[str, str]]
):
) -> None:
serverManagerDB = mainDb.get_database("serverManager")
seeding_db: AsyncIOMotorCollection = serverManagerDB.get_collection("seeding")
await seeding_db.update_one(
{"_id": group_id}, {"$set": {"keepAliveSeeders": used_seeders}}
)


async def get_seeding_groups(mainDb):
async def get_seeding_groups(mainDb) -> list[dict]:
groups = []
serverManagerDB = mainDb.get_database("serverManager")
seeding_db: AsyncIOMotorCollection = serverManagerDB.get_collection("seeding")
Expand All @@ -86,7 +86,9 @@ async def get_seeding_groups(mainDb):
return groups


async def update_server(mainDb, servers: list[str], group_id: str, empty_space: int):
async def update_server(
mainDb, servers: list[str], group_id: str, empty_space: int
) -> tuple[dict[str, dict[str, str]], dict[str, dict[str, str | bool]]]:
used_seeders = await gather_seeding(mainDb, group_id)
server_infos: dict[str, ServerInfo] = {}

Expand Down

0 comments on commit cc5928c

Please sign in to comment.