diff --git a/ad_tasks.py b/ad_tasks.py index 719c5c1..7a9f0b1 100644 --- a/ad_tasks.py +++ b/ad_tasks.py @@ -130,9 +130,10 @@ def send_cache_data(): if line: locationids = json.loads(line.get('locationid')) for locationid in str(locationids).replace('[','').replace(']','').split(','): + locationid = locationid.strip() area_all = get_area_by_locationid(locationid) for area in area_all.split(','): - + area = area.strip() line['locationid'] = locationid line['area'] = area @@ -169,9 +170,11 @@ def send_cache_data(): try: id, gameid, channelid, locationids, status = line for locationid in locationids.replace("[", "").replace("]", "").replace('"', "").split(','): + locationid = locationid.strip() area_all = get_area_by_locationid(locationid) if area_all: for area in area_all.split(','): + area = area.strip() key = f"ad::{gameid}_{locationid}::{channelid}::{area}::{locationid}" values = f"{id}_{locationid}" if my_redis.sismember(key, values):