You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After the 'flow' execution, the function is suspended. The 'flow' state changes, but the execution does not pause and continues. Subsequently, it displays that the 'flow' is not in a paused state.
Version info
prefect v3.3.3
python v3.10
Additional context
`from time import sleep
from prefect import get_client, suspend_flow_run
from prefect.deployments import run_deployment
from prefect.states import Suspended
import asyncio
async def resume_flow(flow_run_id) -> bool:
try:
async with get_client() as client:
result = await client.resume_flow_run(flow_run_id=flow_run_id)
print(f"resume result: {result}")
return result
except Exception as e:
print(f"resume result: {e}")
return False
if name == "main":
new_run_id = run_flow()
print(f"Flow,Run ID: {new_run_id}")
# result = asyncio.run(resume_flow("3c2cc53b-cbdd-4e0c-a8a8-5843a0d3272c"))
if new_run_id:
sleep(10)
if asyncio.run(suspend_flow(new_run_id)):
print("success")
if asyncio.run(resume_flow(new_run_id)):
print("success")`
The text was updated successfully, but these errors were encountered:
Bug summary
After the 'flow' execution, the function is suspended. The 'flow' state changes, but the execution does not pause and continues. Subsequently, it displays that the 'flow' is not in a paused state.
Version info
Additional context
`from time import sleep
from prefect import get_client, suspend_flow_run
from prefect.deployments import run_deployment
from prefect.states import Suspended
import asyncio
flow_run_id = "bc8e3580-634a-461e-b3ae-c32780622f4f"
def run_flow() -> str:
try:
flow_run = run_deployment(
name=flow_run_id,
timeout=10
)
print(f"flow_run: {flow_run}")
return str(flow_run.id)
except Exception as e:
print(f"failed: {e}")
return ""
async def suspend_flow(flow_run_id: str) -> bool:
try:
result = await suspend_flow_run(flow_run_id=flow_run_id)
print(f"result: {result}")
return True
except Exception as e:
print(f"suspend_failed: {e}")
return False
async def resume_flow(flow_run_id) -> bool:
try:
async with get_client() as client:
result = await client.resume_flow_run(flow_run_id=flow_run_id)
print(f"resume result: {result}")
return result
except Exception as e:
print(f"resume result: {e}")
return False
if name == "main":
new_run_id = run_flow()
print(f"Flow,Run ID: {new_run_id}")
The text was updated successfully, but these errors were encountered: