From 4a62f9a8f014b11634a8cda86a79dabb475a8df0 Mon Sep 17 00:00:00 2001 From: pengtao Date: Sun, 29 Sep 2019 12:16:46 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ops/ad_produce.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ops/ad_produce.py b/ops/ad_produce.py index 71c98aa..a474a1a 100644 --- a/ops/ad_produce.py +++ b/ops/ad_produce.py @@ -124,7 +124,7 @@ def produce_task(): if all: for line in all: if line: - print(f"line={line}") + # print(f"line={line}") try: locationids = json.loads(line.get('locationid')) for locationid in str(locationids).strip('[]').split(','): @@ -138,11 +138,13 @@ def produce_task(): key = "ad::{0}::{1}::{2}".format(str01, area, locationid) if int(line['ad_num']) == 0: sadd_adkey(key, line) + print(f"add {line} 2 {key}!") elif int(line['ad_num']) > 0: num = my_redis.get(f"adnum::{line['id']}_{locationid}::num") or 0 print(f" get {line['id']} {locationid} num was {num}!") if int(line['ad_num']) > int(num): sadd_adkey(key, line) + print(f"add {line} 2 {key}!") else: redis_key = f"{line['id']}_{locationid}" if my_redis.sismember(key, redis_key):