Update ensure_future/loop.create_task -> asyncio.create_task
This commit is contained in:
@@ -193,7 +193,7 @@ class AuthAPI(abc.ABC):
|
||||
existing_user = await User.get_by_tgid(user_info.id)
|
||||
if existing_user and existing_user != user:
|
||||
await existing_user.log_out()
|
||||
asyncio.ensure_future(user.post_login(user_info, first_login=True), loop=self.loop)
|
||||
asyncio.create_task(user.post_login(user_info, first_login=True))
|
||||
if user.command_status and user.command_status["action"] == "Login":
|
||||
user.command_status = None
|
||||
|
||||
|
||||
@@ -212,9 +212,7 @@ class ProvisioningAPI(AuthAPI):
|
||||
portal.photo_id = ""
|
||||
await portal.save()
|
||||
|
||||
asyncio.ensure_future(
|
||||
portal.update_matrix_room(user, entity, direct=False, levels=levels), loop=self.loop
|
||||
)
|
||||
asyncio.create_task(portal.update_matrix_room(user, entity, direct=False, levels=levels))
|
||||
|
||||
return web.Response(status=202, body="{}")
|
||||
|
||||
@@ -335,7 +333,7 @@ class ProvisioningAPI(AuthAPI):
|
||||
self.log.exception("Failed to disconnect chat")
|
||||
return self.get_error_response(500, "exception", "Failed to disconnect chat")
|
||||
else:
|
||||
asyncio.ensure_future(coro, loop=self.loop)
|
||||
asyncio.create_task(coro)
|
||||
return web.json_response({}, status=200 if sync else 202)
|
||||
|
||||
async def get_user_info(self, request: web.Request) -> web.Response:
|
||||
|
||||
Reference in New Issue
Block a user