Skip to content

Commit

Permalink
new lines for get_workflow_run parameter - code style update
Browse files Browse the repository at this point in the history
  • Loading branch information
wintonzheng committed Dec 23, 2024
1 parent e10d9e3 commit 1fcf7bc
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 5 deletions.
3 changes: 2 additions & 1 deletion skyvern/forge/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 249,8 @@ async def execute_step(
workflow_run: WorkflowRun | None = None
if task.workflow_run_id:
workflow_run = await app.DATABASE.get_workflow_run(
workflow_run_id=task.workflow_run_id, organization_id=organization.organization_id
workflow_run_id=task.workflow_run_id,
organization_id=organization.organization_id,
)
if workflow_run and workflow_run.status == WorkflowRunStatus.canceled:
LOG.info(
Expand Down
3 changes: 2 additions & 1 deletion skyvern/forge/sdk/routes/agent_protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 312,8 @@ async def cancel_workflow_run(
x_api_key: Annotated[str | None, Header()] = None,
) -> None:
workflow_run = await app.DATABASE.get_workflow_run(
workflow_run_id=workflow_run_id, organization_id=current_org.organization_id
workflow_run_id=workflow_run_id,
organization_id=current_org.organization_id,
)
if not workflow_run:
raise HTTPException(
Expand Down
3 changes: 2 additions & 1 deletion skyvern/forge/sdk/routes/streaming.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 172,8 @@ async def workflow_run_streaming(
return

workflow_run = await app.DATABASE.get_workflow_run(
workflow_run_id=workflow_run_id, organization_id=organization_id
workflow_run_id=workflow_run_id,
organization_id=organization_id,
)
if not workflow_run or workflow_run.organization_id != organization_id:
LOG.info(
Expand Down
3 changes: 2 additions & 1 deletion skyvern/forge/sdk/services/observer_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 484,8 @@ async def handle_block_result(
)
# refresh workflow run model
return await app.WORKFLOW_SERVICE.get_workflow_run(
workflow_run_id=workflow_run_id, organization_id=workflow.organization_id
workflow_run_id=workflow_run_id,
organization_id=workflow.organization_id,
)


Expand Down
3 changes: 2 additions & 1 deletion skyvern/forge/sdk/workflow/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 360,8 @@ async def execute_workflow(
return workflow_run

refreshed_workflow_run = await app.DATABASE.get_workflow_run(
workflow_run_id=workflow_run.workflow_run_id, organization_id=organization_id
workflow_run_id=workflow_run.workflow_run_id,
organization_id=organization_id,
)
if refreshed_workflow_run and refreshed_workflow_run.status not in (
WorkflowRunStatus.canceled,
Expand Down

0 comments on commit 1fcf7bc

Please sign in to comment.