diff options
author | David Baker <dave@matrix.org> | 2016-03-16 15:42:35 +0000 |
---|---|---|
committer | David Baker <dave@matrix.org> | 2016-03-16 15:42:35 +0000 |
commit | 742b6c6d158f46a71724821ce13b8ad535df08bc (patch) | |
tree | dc1b9070d29928e1df77959eed73b104232926fb /synapse | |
parent | take extra return val from check_auth in account too (diff) | |
download | synapse-742b6c6d158f46a71724821ce13b8ad535df08bc.tar.xz |
Use hs get_clock instead of time.time()
Diffstat (limited to '')
-rw-r--r-- | synapse/handlers/auth.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/synapse/handlers/auth.py b/synapse/handlers/auth.py index a9f5e3710b..dba6c76dfc 100644 --- a/synapse/handlers/auth.py +++ b/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): |