From 36f2ebbc07ce09a8a670dd7e44eded87816b91f4 Mon Sep 17 00:00:00 2001 From: pengtao Date: Mon, 16 Sep 2019 16:59:19 +0800 Subject: [PATCH] fix --- ad_tasks.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ad_tasks.py b/ad_tasks.py index 41157a6..07fd5ec 100644 --- a/ad_tasks.py +++ b/ad_tasks.py @@ -24,7 +24,7 @@ def get_area_by_locationid(ldid): sql = f"select area from location where id={ldid}" data = mydb.query(sql) if data: - return data[0][0] + return data[0][0].replace("[", "").replace("]", "").replace('"', "") else: log.error(f"get area from location failed!,sql={sql}") return area @@ -119,13 +119,13 @@ def send_cache_data(): log.error("split data failed", exc_info=True) # 检查ID是否存在播放列表中,以及播放次数是否完毕 if all: - pdb.set_trace() # log.info(f"get data was {all}!\n") for line in all: if line: print(f"1={line}") locationid = json.loads(line.get('locationid')) for item in locationid: + pdb.set_trace() area = get_area_by_locationid(item) for one in area.split(','): key = f"ad::{line.get('gameid', 0)}::{line.get('channelid', 0)}::{one}::{item}"