From afa26ebb9345e80f7f385d1ca5442e11b218509c Mon Sep 17 00:00:00 2001 From: root Date: Mon, 15 Jul 2019 19:18:18 +0800 Subject: [PATCH] n --- ad_interface_tornado.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ad_interface_tornado.py b/ad_interface_tornado.py index 1cc7753..d73ee87 100644 --- a/ad_interface_tornado.py +++ b/ad_interface_tornado.py @@ -56,11 +56,13 @@ def send_cache_data(): log.error("split data failed", exc_info=True) # 检查ID是否存在播放列表中,以及播放次数是否完毕 if all: + log.info(f"get data was {all}!\n") for line in all: key = f"{line.get('gameid', 0)}::{line.get('locationid', 0)}" if my_redis.exists(key): + my_redis.sadd(key,line['id']) # 检查num是否已达到设定数值 - num = my_redis.get(f"{key}:num") + num = my_redis.get(f"{line['id']::num") if not num: num = 0 if line['ad_num'] > 0 and line['ad_num'] <= num: @@ -70,9 +72,9 @@ def send_cache_data(): my_redis.expire(f"{line['id']}::info", 0) else: my_redis.sadd(key, line['id']) - + log.info(f"check {line['id']}::info") if not my_redis.exists(f"{line['id']}::info"): - my_redis.hmset(f"{line['id']}::info", line) + my_redis.hmset(f"{line['id']}::info", line) len_all = len(all) log.info(f"write {len_all} to cache!") @@ -95,7 +97,6 @@ class DispatchHandler(tornado.web.RequestHandler): def _selfGetAdList(self): - pdb.set_trace() try: input = json.loads(self.get_query_argument('body')) gameid = input['gameid']