1
This commit is contained in:
parent
896c45230c
commit
c63e366db0
@ -66,8 +66,10 @@ def readMysqlData(rushtime):
|
|||||||
|
|
||||||
r = getRedis()
|
r = getRedis()
|
||||||
array.sort(key=take_score, reverse=True)
|
array.sort(key=take_score, reverse=True)
|
||||||
score_rank = json.dumps(array)
|
score_rank = []
|
||||||
r.set("game2002api: score_rank", score_rank)
|
for score_index in range(50):
|
||||||
|
score_rank.append(array[score_index])
|
||||||
|
r.set("game2002api: score_rank", json.dumps(score_rank))
|
||||||
|
|
||||||
tornado.ioloop.IOLoop.current().call_later(rushtime,
|
tornado.ioloop.IOLoop.current().call_later(rushtime,
|
||||||
lambda : readMysqlData(rushtime)
|
lambda : readMysqlData(rushtime)
|
||||||
@ -93,7 +95,7 @@ if __name__ == "__main__":
|
|||||||
conf = json.loads(open(CONFIG_DIR + '/rankserver.json', 'r').read())
|
conf = json.loads(open(CONFIG_DIR + '/rankserver.json', 'r').read())
|
||||||
|
|
||||||
app = make_app()
|
app = make_app()
|
||||||
app.listen(conf['listen_port'])
|
app.listen(conf['listen_port'] + 1)
|
||||||
conf['rushtime'] = 300
|
conf['rushtime'] = 300
|
||||||
|
|
||||||
tornado.ioloop.IOLoop.current().call_later(conf['rushtime'],
|
tornado.ioloop.IOLoop.current().call_later(conf['rushtime'],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user