From cae82bd107d7486d0a7576cd3094a9770e6fee9b Mon Sep 17 00:00:00 2001 From: Nyo Date: Tue, 4 Jul 2017 23:16:10 +0200 Subject: [PATCH] Delete timed out tokens --- objects/tokenList.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/objects/tokenList.py b/objects/tokenList.py index bc0f65d..bfeb5cb 100644 --- a/objects/tokenList.py +++ b/objects/tokenList.py @@ -40,7 +40,8 @@ class tokenList: if token in self.tokens: if self.tokens[token].ip != "": userUtils.deleteBanchoSessions(self.tokens[token].userID, self.tokens[token].ip) - self.tokens.pop(token) + t = self.tokens.pop(token) + del t glob.redis.decr("ripple:online_users") def getUserIDFromToken(self, token): @@ -189,6 +190,7 @@ class tokenList: log.debug("{} timed out!!".format(self.tokens[i].username)) self.tokens[i].enqueue(serverPackets.notification("Your connection to the server timed out.")) logoutEvent.handle(self.tokens[i], None) + del timedOutTokens # Schedule a new check (endless loop) threading.Timer(checkTime, self.usersTimeoutCheckLoop, [timeoutTime, checkTime]).start()