Skip to content

Commit ae6b4e6

Browse files
committed
fix: avoid using task
1 parent 92de1b7 commit ae6b4e6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

app/operation/user.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,11 @@ async def validate_user(self, db_user: User) -> UserNotificationResponse:
8585
async def update_user(self, db_user: User) -> UserNotificationResponse:
8686
user = await self.validate_user(db_user)
8787

88-
if db_user.status in (UserStatus.active, UserStatus.on_hold):
89-
user_inbounds = await db_user.inbounds()
90-
asyncio.create_task(node_manager.update_user(user, inbounds=user_inbounds))
88+
if user.status in (UserStatus.active, UserStatus.on_hold):
89+
inbounds = await db_user.inbounds()
90+
await node_manager.update_user(user, inbounds)
9191
else:
92-
asyncio.create_task(node_manager.remove_user(user))
92+
await node_manager.remove_user(user)
9393

9494
return user
9595

0 commit comments

Comments
 (0)