调整日志

This commit is contained in:
pengtao 2019-09-29 15:36:56 +08:00
parent a417abe4df
commit 27dd5d62de

View File

@ -130,7 +130,6 @@ def produce_task():
if all:
for line in all:
if line:
# print(f"line={line}")
try:
locationids = json.loads(line.get('locationid'))
for locationid in str(locationids).strip('[]').split(','):
@ -144,13 +143,11 @@ def produce_task():
key = "ad::{0}::{1}::{2}::{3}".format(str01, line['channelid'], 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):