mirror of
https://github.com/element-hq/synapse
synced 2024-08-20 09:40:22 +00:00
Use hs get_clock instead of time.time()
This commit is contained in:
parent
f5e90422f5
commit
742b6c6d15
1 changed files with 2 additions and 2 deletions
|
@ -36,7 +36,7 @@ logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class AuthHandler(BaseHandler):
|
class AuthHandler(BaseHandler):
|
||||||
SESSION_EXPIRE_SECS = 48 * 60 * 60
|
SESSION_EXPIRE_MS = 48 * 60 * 60 * 1000
|
||||||
|
|
||||||
def __init__(self, hs):
|
def __init__(self, hs):
|
||||||
super(AuthHandler, self).__init__(hs)
|
super(AuthHandler, self).__init__(hs)
|
||||||
|
@ -494,7 +494,7 @@ class AuthHandler(BaseHandler):
|
||||||
last_used = 0
|
last_used = 0
|
||||||
if 'last_used' in sess:
|
if 'last_used' in sess:
|
||||||
last_used = sess['last_used']
|
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]
|
del self.sessions[sid]
|
||||||
|
|
||||||
def hash(self, password):
|
def hash(self, password):
|
||||||
|
|
Loading…
Reference in a new issue