From 66a22dade13fccdbd39e0bf0441a0cb264fb9a24 Mon Sep 17 00:00:00 2001 From: H Vs Date: Sat, 12 Apr 2025 15:05: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 --- common/utils.py | 2 +- tasks.py | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/common/utils.py b/common/utils.py index 5eb7172..1476308 100644 --- a/common/utils.py +++ b/common/utils.py @@ -139,7 +139,7 @@ def wx_add_contacts_from_chatroom_message(wxid:str,chatroom_id:str,contact_wixd: return json.dumps(data, separators=(',', ':'), ensure_ascii=False) -def wx_add_contacts_from_chatroom_task_status(wxid:str,chatroom_id:str,status:int): +def wx_add_contacts_from_chatroom_task_status_message(wxid:str,chatroom_id:str,status:int): content = {"wxid": wxid,"chatroomId":chatroom_id,"status":status} data=kafka_base_message("add-contacts-from-chatroom-task-status",content) return json.dumps(data, separators=(',', ':'), ensure_ascii=False) diff --git a/tasks.py b/tasks.py index 5bfbcf5..4144934 100644 --- a/tasks.py +++ b/tasks.py @@ -439,7 +439,7 @@ def scheduled_task_sync_wx_info(self, redis_config, kafka_config, gewe_config): # if not remaining_chatroot_members: # logger.info(f'{nickname}-{wxid} 在 {chatroom_nickname} 群里没有好友可以邀请') # # 任务状态推送到kafka -# k_message=wx_add_contacts_from_chatroom_task_status(wxid,chatroom_id,2) +# k_message=wx_add_contacts_from_chatroom_task_status_message(wxid,chatroom_id,2) # await kafka_service.send_message_async(k_message) # continue @@ -523,7 +523,7 @@ def scheduled_task_sync_wx_info(self, redis_config, kafka_config, gewe_config): # # 任务状态推送到kafka # task_status=await gewe_service.wx_add_contacts_from_chatroom_task_status_async(wxid,chatroom_id) -# wx_add_contacts_from_chatroom_task_status(wxid,chatroom_id,task_status) +# k_message=wx_add_contacts_from_chatroom_task_status_message(wxid,chatroom_id,task_status) # await kafka_service.send_message_async(k_message) # # 下一个群 # await asyncio.sleep(random.uniform(1.5, 3)) @@ -641,7 +641,7 @@ def scheduled_task_add_contacts_from_chatrooms(self, redis_config, kafka_config, if not remaining_chatroot_members: logger.info(f'{nickname}-{wxid} 在 {chatroom_nickname} 群里没有好友可以邀请') # 任务状态推送到kafka - k_message = wx_add_contacts_from_chatroom_task_status(wxid, chatroom_id, 2) + k_message = wx_add_contacts_from_chatroom_task_status_message(wxid, chatroom_id, 2) await kafka_service.send_message_async(k_message) continue @@ -725,7 +725,7 @@ def scheduled_task_add_contacts_from_chatrooms(self, redis_config, kafka_config, await asyncio.sleep(random.uniform(30, 60)) # 任务状态推送到kafka task_status = await gewe_service.wx_add_contacts_from_chatroom_task_status_async(wxid, chatroom_id) - wx_add_contacts_from_chatroom_task_status(wxid, chatroom_id, task_status) + k_message=wx_add_contacts_from_chatroom_task_status_message(wxid, chatroom_id, task_status) await kafka_service.send_message_async(k_message) # 下一个群 await asyncio.sleep(random.uniform(1.5, 3)) @@ -880,7 +880,7 @@ def scheduled_task_add_contacts_from_chatrooms(self, redis_config, kafka_config, # if not remaining_chatroot_members: # logger.info(f'{nickname}-{wxid} 在 {chatroom_nickname} 群里没有好友可以邀请') # # 任务状态推送到kafka -# k_message = wx_add_contacts_from_chatroom_task_status(wxid, chatroom_id, 2) +# k_message = wx_add_contacts_from_chatroom_task_status_message(wxid, chatroom_id, 2) # await kafka_service.send_message_async(k_message) # return @@ -964,7 +964,7 @@ def scheduled_task_add_contacts_from_chatrooms(self, redis_config, kafka_config, # await asyncio.sleep(random.uniform(30, 60)) # # 任务状态推送到kafka # task_status = await gewe_service.wx_add_contacts_from_chatroom_task_status_async(wxid, chatroom_id) -# wx_add_contacts_from_chatroom_task_status(wxid, chatroom_id, task_status) +# wx_add_contacts_from_chatroom_task_status_message(wxid, chatroom_id, task_status) # await kafka_service.send_message_async(k_message) # # 下一个群 # await asyncio.sleep(random.uniform(1.5, 3))