调整缓存数据生成脚本

This commit is contained in:
pengtao 2019-09-29 12:11:59 +08:00
parent 2c90079454
commit a24dbf06c2

View File

@ -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: