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)