调整location area字段名称

This commit is contained in:
pengtao 2019-09-17 12:02:00 +08:00
parent a0f65be27a
commit 1853e48117

View File

@ -52,15 +52,14 @@ def sadd_adkey(key, line):
redis_key = f"{line['id']}_{locationid}" redis_key = f"{line['id']}_{locationid}"
my_redis.sadd(key, redis_key) my_redis.sadd(key, redis_key)
my_redis.expire(key, 60*2) my_redis.expire(key, 60*2)
log.info(f"add {redis_key} 2 {key}!") #log.info(f"add {redis_key} 2 {key}!")
info_key = f"adinfo::{redis_key}::info" info_key = f"adinfo::{redis_key}::info"
new_line = split_ad_info(locationid, line) new_line = split_ad_info(locationid, line)
if new_line: if new_line:
my_redis.hmset(info_key, new_line) my_redis.hmset(info_key, new_line)
my_redis.expire(info_key, 60 * 2) my_redis.expire(info_key, 60 * 2)
log.info(f"add info {new_line} 2 {info_key}!") #log.info(f"add info {new_line} 2 {info_key}!")
else: else:
log.error(f"split adinfo about locationid failed! localtionid={locationid} ") log.error(f"split adinfo about locationid failed! localtionid={locationid} ")
@ -127,10 +126,8 @@ def send_cache_data():
log.error("split data failed", exc_info=True) log.error("split data failed", exc_info=True)
# 检查ID是否存在播放列表中以及播放次数是否完毕 # 检查ID是否存在播放列表中以及播放次数是否完毕
if all: if all:
# log.info(f"get data was {all}!\n")
for line in all: for line in all:
if line: if line:
#print(f"1={line}")
locationids = json.loads(line.get('locationid')) locationids = json.loads(line.get('locationid'))
for locationid in locationids: for locationid in locationids:
area_all = get_area_by_locationid(locationid) area_all = get_area_by_locationid(locationid)