Use hs get_clock instead of time.time()

This commit is contained in:
David Baker 2016-03-16 15:42:35 +00:00
parent f5e90422f5
commit 742b6c6d15
1 changed files with 2 additions and 2 deletions

View File

@ -36,7 +36,7 @@ logger = logging.getLogger(__name__)
class AuthHandler(BaseHandler):
SESSION_EXPIRE_SECS = 48 * 60 * 60
SESSION_EXPIRE_MS = 48 * 60 * 60 * 1000
def __init__(self, hs):
super(AuthHandler, self).__init__(hs)
@ -494,7 +494,7 @@ class AuthHandler(BaseHandler):
last_used = 0
if 'last_used' in sess:
last_used = sess['last_used']
if last_used < time.time() - AuthHandler.SESSION_EXPIRE_SECS:
if last_used < self.hs.get_clock().time() - AuthHandler.SESSION_EXPIRE_MS:
del self.sessions[sid]
def hash(self, password):