fix some error
This commit is contained in:
parent
3d0a66da68
commit
5f9e232c9f
@ -105,23 +105,24 @@ class DispatchHandler(tornado.web.RequestHandler):
|
||||
log.error(result)
|
||||
self.write_error(2)
|
||||
|
||||
|
||||
key = f"{gameid}::{locationid}"
|
||||
ids = my_redis.smembers(key)
|
||||
info = []
|
||||
try:
|
||||
for id in ids:
|
||||
temp = my_redis.hgetall(f"{id}::info")
|
||||
info.append(temp)
|
||||
result = {'errcode': 0, "errmsg": '', "message": {"totoal": len(info), "result": json.dumps(info)}}
|
||||
except Exception as e:
|
||||
result = {'errcode': 1, "errmsg": e}
|
||||
finally:
|
||||
if gameid and locationid:
|
||||
key = f"{gameid}::{locationid}"
|
||||
ids = my_redis.smembers(key)
|
||||
info = []
|
||||
try:
|
||||
for id in ids:
|
||||
temp = my_redis.hgetall(f"{id}::info")
|
||||
info.append(temp)
|
||||
result = {'errcode': 0, "errmsg": '', "message": {"totoal": len(info), "result": json.dumps(info)}}
|
||||
except Exception as e:
|
||||
result = {'errcode': 1, "errmsg": e}
|
||||
finally:
|
||||
self.write(result)
|
||||
else:
|
||||
result = {'errcode': 2, "errmsg": f"get args failed!"}
|
||||
self.write(result)
|
||||
|
||||
|
||||
|
||||
|
||||
def make_app():
|
||||
return tornado.web.Application([(r"/webapp/index[\.]php", DispatchHandler)])
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user