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