Use hs get_clock instead of time.time()

pull/4/merge
David Baker 9 years ago
parent f5e90422f5
commit 742b6c6d15
  1. 4
      synapse/handlers/auth.py

@ -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):

Loading…
Cancel
Save