fixed delete_expired_sessions() again
This commit is contained in:
parent
7770dcf7bc
commit
252413ae40
1 changed files with 5 additions and 2 deletions
|
|
@ -148,7 +148,7 @@ class SessionInterface:
|
||||||
null_session_class = NullSession
|
null_session_class = NullSession
|
||||||
|
|
||||||
#: all sessions that are currently open
|
#: all sessions that are currently open
|
||||||
sessions = []
|
sessions: SessionInterface = []
|
||||||
|
|
||||||
#: A flag that indicates if the session interface is pickle based.
|
#: A flag that indicates if the session interface is pickle based.
|
||||||
#: This can be used by Flask extensions to make a decision in regards
|
#: This can be used by Flask extensions to make a decision in regards
|
||||||
|
|
@ -287,7 +287,10 @@ class SessionInterface:
|
||||||
for session in self.sessions:
|
for session in self.sessions:
|
||||||
number_of_sessions = len(self.sessions)
|
number_of_sessions = len(self.sessions)
|
||||||
|
|
||||||
if self.get_expiration_time(app, session) is None:
|
if (
|
||||||
|
self.get_expiration_time(app, session) is None
|
||||||
|
or datetime.now(timezone.utc) is None
|
||||||
|
):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if self.get_expiration_time(app, session) < datetime.now(timezone.utc):
|
if self.get_expiration_time(app, session) < datetime.now(timezone.utc):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue