From f45aeb1c4a456fda21393bd2282a6338c4f6c7a9 Mon Sep 17 00:00:00 2001 From: H Vs Date: Thu, 10 Apr 2025 10:56:20 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tasks.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tasks.py b/tasks.py index d912ede..c66829c 100644 --- a/tasks.py +++ b/tasks.py @@ -685,7 +685,6 @@ def scheduled_task_add_contacts_from_chatrooms(self, redis_config, kafka_config, chatroom_member_list = list(chatroom_member_list) # 如果 memberList 不是列表,将其转换为列表 - remaining_chatroot_members = [x for x in chatroom_member_list if x.get('wxid') not in contact_wxids_set] nickname = next((member['nickName'] for member in chatroom_member_list if member['wxid'] == wxid), None) @@ -712,7 +711,7 @@ def scheduled_task_add_contacts_from_chatrooms(self, redis_config, kafka_config, # 判断是否过于频繁 is_wx_expection = await gewe_service.get_wx_expection_async(wxid,"addGroupMemberAsFriend") if is_wx_expection: - logger.info(f"{wxid} 本次任务接口addGroupMemberAsFriend异常,不再邀请,{is_wx_expection}") + logger.info(f"{wxid} 本次任务接口addGroupMemberAsFriend异常,不再邀请,{is_wx_expection}") return contact_wxid= m.get('wxid') @@ -773,7 +772,7 @@ def scheduled_task_add_contacts_from_chatrooms(self, redis_config, kafka_config, k_message = wx_add_contacts_from_chatroom_message(history.wxid,history.chatroomId,history.contactWixd,history.addTime) await kafka_service.send_message_async(k_message) #await asyncio.sleep(random.uniform(1.5, 3)) - await asyncio.sleep(random.uniform(10,60)) + await asyncio.sleep(random.uniform(30,60)) # 任务状态推送到kafka task_status=await gewe_service.wx_add_contacts_from_chatroom_task_status_async(wxid,chatroom_id)