修复计数器key出现utf-8的BUG
This commit is contained in:
parent
ec7471e22b
commit
ddd04dc24d
@ -70,22 +70,25 @@ class DispatchHandler(tornado.web.RequestHandler):
|
|||||||
def _upAdRecording(self):
|
def _upAdRecording(self):
|
||||||
try:
|
try:
|
||||||
adid = unquote(self.get_query_argument('adid'), 'utf-8')
|
adid = unquote(self.get_query_argument('adid'), 'utf-8')
|
||||||
localtionid = self.get_query_argument('locationid', 'utf-8')
|
localtionid = self.get_query_argument('locationid')
|
||||||
|
|
||||||
log.info(f" get adid was {adid}")
|
log.info(f" get adid was {adid}")
|
||||||
ids = json.loads(adid)
|
ids = json.loads(adid)
|
||||||
except Exception:
|
except Exception:
|
||||||
result = {'errcode': 2, "errmsg": f"get args failed`"}
|
result = {'errcode': 2, "errmsg": f"get args failed`"}
|
||||||
log.error(result, exc_info=True)
|
log.error(result, exc_info=True)
|
||||||
self.write({'errcode': 1, "errmsg": 'get adid failed!'})
|
self.write({'errcode': 1, "errmsg": 'get adid failed!'})
|
||||||
|
if localtionid:
|
||||||
if ids:
|
if ids:
|
||||||
for id in ids:
|
for id in ids:
|
||||||
if id:
|
if id:
|
||||||
key = f"adnum::{id}_{localtionid}::num"
|
key = f"adnum::{id}_{localtionid}::num"
|
||||||
my_redis.incr(key, amount=1)
|
my_redis.incr(key, amount=1)
|
||||||
self.write({'errcode': 0, "errmsg": '', "message": f"{ids} incr success!"})
|
self.write({'errcode': 0, "errmsg": '', "message": f"{ids} incr success!"})
|
||||||
|
else:
|
||||||
|
self.write({'errcode': 1, "errmsg": 'get adid failed!'})
|
||||||
else:
|
else:
|
||||||
self.write({'errcode': 1, "errmsg": 'get adid failed!'})
|
self.write({'errcode': 1, "errmsg": 'get localtionid failed!'})
|
||||||
|
|
||||||
|
|
||||||
def _selfCheckingHandler(self):
|
def _selfCheckingHandler(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user