Commit fddde0fe authored by minus's avatar minus

used setex instead of set

parent 914c32ec
......@@ -34,11 +34,11 @@ class RefreshingServer(Server):
def on_info_received(self):
server_info = json.dumps({k: v for k, v in filter(lambda it: not it[0].startswith("_"), self.__dict__.items())}, cls=TeeworldsJSONEncoder)
detail_key_name = "server:{}".format(str(self.address))
rconn.set(detail_key_name, server_info, ex=SERVER_TIMEOUT)
rconn.setex(detail_key_name, SERVER_TIMEOUT, server_info)
for player in self.playerlist:
player_key_name = "player:{}:{}".format(player.name, str(self.address))
player_info = json.dumps({k: v for k, v in filter(lambda it: not it[0].startswith("_"), player.__dict__.items())}, cls=TeeworldsJSONEncoder)
rconn.set(player_key_name, player_info, ex=PLAYER_TIMEOUT)
rconn.setex(player_key_name, PLAYER_TIMEOUT, player_info)
self._socket.call_later(SERVER_REFRESH_INTERVAL, self.request_info)
#self._socket.call_later(SERVER_TIMEOUT, self.on_timeout)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment