fix some error
This commit is contained in:
parent
e151833f40
commit
b51976defc
@ -62,7 +62,7 @@ def send_cache_data():
|
|||||||
# 检查num是否已达到设定数值
|
# 检查num是否已达到设定数值
|
||||||
num = my_redis.get(f"{key}:num")
|
num = my_redis.get(f"{key}:num")
|
||||||
if not num:
|
if not num:
|
||||||
num=0
|
num = 0
|
||||||
if line['ad_num'] > 0 and line['ad_num'] <= num:
|
if line['ad_num'] > 0 and line['ad_num'] <= num:
|
||||||
# 该广告已播放达到次数,从缓存中清除
|
# 该广告已播放达到次数,从缓存中清除
|
||||||
my_redis.srem(key, line['id'])
|
my_redis.srem(key, line['id'])
|
||||||
@ -97,17 +97,19 @@ class DispatchHandler(tornado.web.RequestHandler):
|
|||||||
def _selfGetAdList(self):
|
def _selfGetAdList(self):
|
||||||
input = json.loads(self.get_query_argument('body'))
|
input = json.loads(self.get_query_argument('body'))
|
||||||
gameid = input['gameid']
|
gameid = input['gameid']
|
||||||
localid = input['localid']
|
locationid = input['locationid']
|
||||||
key = f"{gameid}::{localid}"
|
key = f"{gameid}::{locationid}"
|
||||||
ids = my_redis.smembers(key)
|
ids = my_redis.smembers(key)
|
||||||
info = []
|
info = []
|
||||||
pdb.set_trace()
|
try:
|
||||||
for id in ids:
|
for id in ids:
|
||||||
keys=f"{id}::info"
|
temp = my_redis.hgetall(f"{id}::info")
|
||||||
temp = my_redis.hgetall(f"{id}::info")
|
info.append(temp)
|
||||||
info.append(temp)
|
result = {'errcode': 0, "errmsg": '', "message": {"totoal": len(info), "result": json.dumps(info)}}
|
||||||
result={'code':200,"message":{"totoal":len(info),"result":json.dumps(info)}}
|
except Exception as e:
|
||||||
self.write(result)
|
result = {'errcode': 1, "errmsg": e}
|
||||||
|
finally:
|
||||||
|
self.write(result)
|
||||||
|
|
||||||
|
|
||||||
def make_app():
|
def make_app():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user