修复计数器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):
|
||||
try:
|
||||
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}")
|
||||
ids = json.loads(adid)
|
||||
except Exception:
|
||||
result = {'errcode': 2, "errmsg": f"get args failed`"}
|
||||
log.error(result, exc_info=True)
|
||||
self.write({'errcode': 1, "errmsg": 'get adid failed!'})
|
||||
|
||||
if ids:
|
||||
for id in ids:
|
||||
if id:
|
||||
key = f"adnum::{id}_{localtionid}::num"
|
||||
my_redis.incr(key, amount=1)
|
||||
self.write({'errcode': 0, "errmsg": '', "message": f"{ids} incr success!"})
|
||||
if localtionid:
|
||||
if ids:
|
||||
for id in ids:
|
||||
if id:
|
||||
key = f"adnum::{id}_{localtionid}::num"
|
||||
my_redis.incr(key, amount=1)
|
||||
self.write({'errcode': 0, "errmsg": '', "message": f"{ids} incr success!"})
|
||||
else:
|
||||
self.write({'errcode': 1, "errmsg": 'get adid failed!'})
|
||||
else:
|
||||
self.write({'errcode': 1, "errmsg": 'get adid failed!'})
|
||||
self.write({'errcode': 1, "errmsg": 'get localtionid failed!'})
|
||||
|
||||
|
||||
def _selfCheckingHandler(self):
|
||||
|
Loading…
x
Reference in New Issue
Block a user