Skip to content

Commit 4e4b739

Browse files
committed
Fix: don't overwrite SessionStore.ttl to use as the setex parameter, compute it. Sheesh.
1 parent 02539f9 commit 4e4b739

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

credenza/api/session/storage/session_store.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,6 @@ def create_session(self,
129129
now = time.time()
130130
if expires_at is None:
131131
expires_at = (now + self.ttl)
132-
else:
133-
self.ttl = int(expires_at - now)
134132

135133
session_data = SessionData(
136134
id_token=id_token,
@@ -152,7 +150,7 @@ def create_session(self,
152150

153151
session_key = access_token if use_access_token_as_session_key else self.generate_session_key()
154152
self.map_session(session_key, session_id)
155-
self.backend.setex(self._key(session_id), session_json, self.ttl)
153+
self.backend.setex(self._key(session_id), session_json, int(expires_at - now))
156154

157155
logger.debug(f"Created session {session_id} (realm={realm})")
158156
return session_key, session_data

0 commit comments

Comments
 (0)