From 1b78c3f0ffe72fec32e46762b05ecc5005a3f49a Mon Sep 17 00:00:00 2001 From: H Vs Date: Fri, 14 Mar 2025 10:53:27 +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 --- app.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app.py b/app.py index 1943338..3b54afb 100644 --- a/app.py +++ b/app.py @@ -462,10 +462,10 @@ class WechatThreadManager: cache_wxids = [c.get('userName') for c in cache] new_friend_wxids = [wxid for wxid in friend_wxids if wxid not in cache_wxids] data=self.wxchat.save_contacts_brief_to_cache(token_id, app_id, wxid, friend_wxids) - # 推送到kafka - - input_message=utils.wx_all_contacts(wxid,data) - kafka_helper.kafka_client.produce_message(input_message) + if len(new_friend_wxids)>0: + # 推送到kafka + input_message=utils.wx_all_contacts(wxid,data) + kafka_helper.kafka_client.produce_message(input_message) logger.info(f'微信ID {wxid} 登录APPID {app_id} 成功,联系人已定时保存')