H Vs пре 1 недеља
родитељ
комит
66a22dade1
2 измењених фајлова са 7 додато и 7 уклоњено
  1. +1
    -1
      common/utils.py
  2. +6
    -6
      tasks.py

+ 1
- 1
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)


+ 6
- 6
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))


Loading…
Откажи
Сачувај