fix scoreboard caching

master
James Sigurðarson 2016-08-12 14:10:48 +01:00
parent 49435b11cf
commit d6cbf6ad3c
1 changed files with 5 additions and 4 deletions

View File

@ -1,15 +1,16 @@
import redis
import data.scoreboard
from data import scoreboard
import json
import config
r = redis.StrictRedis()
r = redis.StrictRedis(host=config.redis.host, port=config.redis.port, db=config.redis.db)
def set_complex(key, val):
r.set(key, json.dumps(val))
def run():
data = data.scoreboard.calculate_scores()
graphdata = utils.scoreboard.calculate_graph(data)
data = scoreboard.calculate_scores()
graphdata = scoreboard.calculate_graph(data)
set_complex("scoreboard", data)
set_complex("graph", graphdata)