返回广告列表前判断内容,不返回状态为null的信息

This commit is contained in:
pengtao 2019-09-19 11:09:52 +08:00
parent 284733cb54
commit f633966e3c

View File

@ -170,13 +170,14 @@ def send_cache_data():
id, gameid, channelid, locationids, status = line
for locationid in locationids.replace("[", "").replace("]", "").replace('"', "").split(','):
area_all = get_area_by_locationid(locationid)
for area in area_all.split(','):
key = f"ad::{gameid}_{locationid}::{channelid}::{area}::{locationid}"
values = f"{id}_{locationid}"
if my_redis.sismember(key, values):
my_redis.srem(key, values)
my_redis.expire(f"adinfo::{values}::info", 1)
log.info(f"remove {id} from {key} success!")
if area_all:
for area in area_all.split(','):
key = f"ad::{gameid}_{locationid}::{channelid}::{area}::{locationid}"
values = f"{id}_{locationid}"
if my_redis.sismember(key, values):
my_redis.srem(key, values)
my_redis.expire(f"adinfo::{values}::info", 1)
log.info(f"remove {id} from {key} success!")
except Exception:
log.error("拆解过期数据出错!", exc_info=True)