do not clean up workflow in a task v2 block (#1771)
This commit is contained in:
@@ -130,11 +130,19 @@ class BrowserManager:
|
||||
url: str | None = None,
|
||||
browser_session_id: str | None = None,
|
||||
) -> BrowserState:
|
||||
browser_state = self.get_for_workflow_run(workflow_run_id=workflow_run.workflow_run_id)
|
||||
parent_workflow_run_id = workflow_run.parent_workflow_run_id
|
||||
workflow_run_id = workflow_run.workflow_run_id
|
||||
browser_state = self.get_for_workflow_run(workflow_run_id=workflow_run_id)
|
||||
if parent_workflow_run_id:
|
||||
browser_state = self.get_for_workflow_run(workflow_run_id=parent_workflow_run_id)
|
||||
if browser_state:
|
||||
self.pages[workflow_run_id] = browser_state
|
||||
|
||||
if browser_state is not None:
|
||||
return browser_state
|
||||
|
||||
if browser_session_id:
|
||||
# TODO: what if there's a parent workflow run?
|
||||
LOG.info(
|
||||
"Getting browser state for workflow run from persistent sessions manager",
|
||||
browser_session_id=browser_session_id,
|
||||
@@ -171,7 +179,9 @@ class BrowserManager:
|
||||
organization_id=workflow_run.organization_id,
|
||||
)
|
||||
|
||||
self.pages[workflow_run.workflow_run_id] = browser_state
|
||||
self.pages[workflow_run_id] = browser_state
|
||||
if parent_workflow_run_id:
|
||||
self.pages[parent_workflow_run_id] = browser_state
|
||||
|
||||
# The URL here is only used when creating a new page, and not when using an existing page.
|
||||
# This will make sure browser_state.page is not None.
|
||||
|
||||
Reference in New Issue
Block a user