Related : https://github.com/OCA/server-tools/issues/1482
@api.model_cr_context
def _auth_timeout_check(self):
"""Perform session timeout validation and expire if needed."""
if not http.request:
return
session = http.request.session
# Calculate deadline
deadline = self._auth_timeout_deadline_calculate()
# Check if past deadline
expired = False
if deadline is not False:
path = http.root.session_store.get_session_filename(session.sid)
try:
expired = getmtime(path) < deadline
except FileNotFoundError:
_logger.exception(
'File nya tidak ada %s, Path : %s',(path, http.request.httprequest.path)
)
except OSError:
_logger.exception(
'Exception reading session file modified time.',
)
# Force expire the session. Will be resolved with new session.
expired = True
..show all:.
.
Related : https://github.com/OCA/server-tools/issues/1482
@api.model_cr_context
def _auth_timeout_check(self):
"""Perform session timeout validation and expire if needed."""
if not http.request:
return
session = http.request.session
# Calculate deadline
deadline = self._auth_timeout_deadline_calculate()
# Check if past deadline
expired = False
if deadline is not False:
path = http.root.session_store.get_session_filename(session.sid)
try:
expired = getmtime(path) < deadline
except FileNotFoundError:
_logger.exception(
'File nya tidak ada %s, Path : %s',(path, http.request.httprequest.path)
)
except OSError:
_logger.exception(
'Exception reading session file modified time.',
)
# Force expire the session. Will be resolved with new session.
expired = True
No comments:
Post a Comment