diff --git a/ad_tasks.py b/ad_tasks.py index fd848ea..dca1313 100644 --- a/ad_tasks.py +++ b/ad_tasks.py @@ -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)