The newly-created ReportSession for this browser connection.
if UNCLAIMED_PREHEATED_ID in self._session_info_by_id:
assert len(self._session_info_by_id) == 1
LOGGER.debug("Reusing preheated context for ws %s", ws)
session = self._session_info_by_id[UNCLAIMED_PREHEATED_ID].session
After Change
The newly-created ReportSession for this browser connection.
if self._preheated_session_id is not None:
assert len(self._session_info_by_id) == 1
assert ws is not None
session_id = self._preheated_session_id
self._preheated_session_id = None
session_info = self._session_info_by_id[session_id]
session_info.ws = ws
session = session_info.session
LOGGER.debug(
"Reused preheated session for ws %s. Session ID: %s", id(ws), session_id
)
else:
session = ReportSession(
ioloop=self._ioloop,
script_path=self._script_path,
command_line=self._command_line,
uploaded_file_manager=self._uploaded_file_mgr,
)
LOGGER.debug(
"Created new session for ws %s. Session ID: %s", id(ws), session.id
)
assert session.id not in self._session_info_by_id, (