开启日志用于调试

This commit is contained in:
pengtao 2019-10-09 16:57:41 +08:00
parent e7e274f4d6
commit 15d4f4bb90

View File

@ -31,6 +31,7 @@ def get_area_by_locationid(ldid):
def split_ad_info(localtionid, line):
# 从locationid获取位置相关属性与ad信息打包产生提供给接口用的数据
log.info(f"split_ad_info {localtionid} {line} ")
new = copy.deepcopy(line)
location_sql = f"select x,y,x_offset,y_offset,type,mode,ld_property from location WHERE id={localtionid}"
data = mydb.query(location_sql)
@ -143,11 +144,13 @@ def produce_task():
str01 = f"{line.get('gameid', 0)}_{locationid}_{area}"
key = "ad::{0}::{1}::{2}::{3}".format(str01, line['channelid'], area, locationid)
if int(line['ad_num']) == 0:
log.info(f"add {key} {line}")
sadd_adkey(key, line)
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):
log.info(f"add {key} {line}")
sadd_adkey(key, line)
else:
redis_key = f"{line['id']}_{locationid}"