INNER CODE UNIT · Python
shutdown
gbtami/pychess-variants · server/server.py:229
async def shutdown(app: Application) -> None:
app_state = get_app_state(app)
await app_state.server_shutdown()
async def close_mongodb_client(app: Application) -> None:
if client_key in app:
try:
await app[client_key].close()
log.debug("\nAsyncMongoClient closed OK.\n")
except TypeError:
close_result = app[client_key].close()
if asyncio.iscoroutine(close_result):
await close_result
log.debug("\nAsyncMongoMockClient closed OK.\n")
if __name__ == "__main__":