6363 UserSubscriptionUpdateList ,
6464)
6565from app .node .sync import remove_user as sync_remove_user
66- from app .node .sync import schedule_sync_task , sync_proto_user , sync_user , sync_users
67- from app .node .user import serialize_user
66+ from app .node .sync import schedule_sync_task , sync_proto_user , sync_proto_users , sync_user , sync_users
67+ from app .node .user import serialize_user , serialize_users_for_node
6868from app .operation import BaseOperation , OperatorType
6969from app .settings import subscription_settings
7070from app .utils .jwt import create_subscription_token
@@ -746,7 +746,8 @@ def builder(username: str):
746746 async def bulk_modify_expire (self , db : AsyncSession , bulk_model : BulkUser ):
747747 users , users_count = await update_users_expire (db , bulk_model )
748748 if self ._is_non_blocking_sync_operator (self .operator_type ):
749- schedule_sync_task (sync_users (users ))
749+ proto_users = await serialize_users_for_node (users )
750+ schedule_sync_task (sync_proto_users (proto_users ))
750751 else :
751752 await sync_users (users )
752753
@@ -757,7 +758,8 @@ async def bulk_modify_expire(self, db: AsyncSession, bulk_model: BulkUser):
757758 async def bulk_modify_datalimit (self , db : AsyncSession , bulk_model : BulkUser ):
758759 users , users_count = await update_users_datalimit (db , bulk_model )
759760 if self ._is_non_blocking_sync_operator (self .operator_type ):
760- schedule_sync_task (sync_users (users ))
761+ proto_users = await serialize_users_for_node (users )
762+ schedule_sync_task (sync_proto_users (proto_users ))
761763 else :
762764 await sync_users (users )
763765
@@ -768,7 +770,8 @@ async def bulk_modify_datalimit(self, db: AsyncSession, bulk_model: BulkUser):
768770 async def bulk_modify_proxy_settings (self , db : AsyncSession , bulk_model : BulkUsersProxy ):
769771 users , users_count = await update_users_proxy_settings (db , bulk_model )
770772 if self ._is_non_blocking_sync_operator (self .operator_type ):
771- schedule_sync_task (sync_users (users ))
773+ proto_users = await serialize_users_for_node (users )
774+ schedule_sync_task (sync_proto_users (proto_users ))
772775 else :
773776 await sync_users (users )
774777
0 commit comments