From 64fd77ed9e90c63a191579f53a5897aa35f7323b Mon Sep 17 00:00:00 2001 From: pengtao Date: Thu, 19 Sep 2019 11:25:24 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=94=E5=9B=9E=E5=B9=BF=E5=91=8A=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E5=89=8D=E5=88=A4=E6=96=AD=E5=86=85=E5=AE=B9=EF=BC=8C?= =?UTF-8?q?=E4=B8=8D=E8=BF=94=E5=9B=9E=E7=8A=B6=E6=80=81=E4=B8=BAnull?= =?UTF-8?q?=E7=9A=84=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ad_tasks.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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):