mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 20:21:32 -06:00
use async await to close websocket server
This commit is contained in:
@@ -485,7 +485,8 @@ def set_password(ctx : Context, password):
|
||||
|
||||
|
||||
async def console(ctx: Context):
|
||||
while True:
|
||||
running = True
|
||||
while running:
|
||||
input = await aioconsole.ainput()
|
||||
try:
|
||||
|
||||
@@ -494,8 +495,8 @@ async def console(ctx : Context):
|
||||
continue
|
||||
|
||||
if command[0] == '/exit':
|
||||
ctx.server.ws_server.close()
|
||||
break
|
||||
await ctx.server.ws_server._close()
|
||||
running = False
|
||||
|
||||
if command[0] == '/players':
|
||||
logging.info(get_connected_players_string(ctx))
|
||||
|
Reference in New Issue
Block a user