From a24dbf06c209f044e7b9c30695ad4e7848b40772 Mon Sep 17 00:00:00 2001 From: pengtao Date: Sun, 29 Sep 2019 12:11:59 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=BC=93=E5=AD=98=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E7=94=9F=E6=88=90=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ops/ad_produce.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ops/ad_produce.py b/ops/ad_produce.py index f17f47d..3ebfbe6 100644 --- a/ops/ad_produce.py +++ b/ops/ad_produce.py @@ -139,10 +139,8 @@ def produce_task(): if int(line['ad_num']) == 0: sadd_adkey(key, line) elif int(line['ad_num']) > 0: - num = my_redis.get(f"adnum::{line['id']}_{locationid}::num") + num = my_redis.get(f"adnum::{line['id']}_{locationid}::num") or 0 print(f" get {line['id']} {locationid} num was {num}!") - if not num: - num = 0 if int(line['ad_num']) > int(num): sadd_adkey(key, line) else: