Move get_workflow_script_by_cache_key_value to replica (#4303)
This commit is contained in:
committed by
GitHub
parent
781bd13c5a
commit
1e5b8b36c1
@@ -418,7 +418,7 @@ async def get_workflow_script_blocks(
|
|||||||
raise HTTPException(status_code=404, detail="Workflow not found")
|
raise HTTPException(status_code=404, detail="Workflow not found")
|
||||||
workflow_run_id = block_script_request.workflow_run_id
|
workflow_run_id = block_script_request.workflow_run_id
|
||||||
if workflow_run_id:
|
if workflow_run_id:
|
||||||
workflow_run = await app.DATABASE.get_workflow_run(
|
workflow_run = await app.REPLICA_DATABASE.get_workflow_run(
|
||||||
workflow_run_id=workflow_run_id,
|
workflow_run_id=workflow_run_id,
|
||||||
organization_id=current_org.organization_id,
|
organization_id=current_org.organization_id,
|
||||||
)
|
)
|
||||||
@@ -441,7 +441,7 @@ async def get_workflow_script_blocks(
|
|||||||
cache_key = block_script_request.cache_key or workflow.cache_key or ""
|
cache_key = block_script_request.cache_key or workflow.cache_key or ""
|
||||||
status = block_script_request.status
|
status = block_script_request.status
|
||||||
|
|
||||||
script = await app.DATABASE.get_workflow_script_by_cache_key_value(
|
script = await app.REPLICA_DATABASE.get_workflow_script_by_cache_key_value(
|
||||||
organization_id=current_org.organization_id,
|
organization_id=current_org.organization_id,
|
||||||
workflow_permanent_id=workflow_permanent_id,
|
workflow_permanent_id=workflow_permanent_id,
|
||||||
workflow_run_id=block_script_request.workflow_run_id,
|
workflow_run_id=block_script_request.workflow_run_id,
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ async def get_workflow_script(
|
|||||||
rendered_cache_key_value = ""
|
rendered_cache_key_value = ""
|
||||||
|
|
||||||
try:
|
try:
|
||||||
parameter_tuples = await app.DATABASE.get_workflow_run_parameters(
|
parameter_tuples = await app.REPLICA_DATABASE.get_workflow_run_parameters(
|
||||||
workflow_run_id=workflow_run.workflow_run_id,
|
workflow_run_id=workflow_run.workflow_run_id,
|
||||||
)
|
)
|
||||||
parameters = {wf_param.key: run_param.value for wf_param, run_param in parameter_tuples}
|
parameters = {wf_param.key: run_param.value for wf_param, run_param in parameter_tuples}
|
||||||
@@ -78,7 +78,7 @@ async def get_workflow_script(
|
|||||||
return None, rendered_cache_key_value
|
return None, rendered_cache_key_value
|
||||||
|
|
||||||
# Check if there are existing cached scripts for this workflow + cache_key_value
|
# Check if there are existing cached scripts for this workflow + cache_key_value
|
||||||
existing_script = await app.DATABASE.get_workflow_script_by_cache_key_value(
|
existing_script = await app.REPLICA_DATABASE.get_workflow_script_by_cache_key_value(
|
||||||
organization_id=workflow.organization_id,
|
organization_id=workflow.organization_id,
|
||||||
workflow_permanent_id=workflow.workflow_permanent_id,
|
workflow_permanent_id=workflow.workflow_permanent_id,
|
||||||
cache_key_value=rendered_cache_key_value,
|
cache_key_value=rendered_cache_key_value,
|
||||||
|
|||||||
Reference in New Issue
Block a user