Elliott Wilson
07/27/2023, 3:06 PMMarvin
07/27/2023, 3:06 PMreschedule
flag to True
. To use this feature, flows that pause with the reschedule
flag must have an associated deployment and results configured with the persist_results
flag.
Here's an example of a flow that does not block flow execution while paused. This flow will exit after one task, and will be rescheduled upon resuming. The stored result of the first task is retrieved instead of being rerun.
python
from prefect import flow, pause_flow_run, task
@task(persist_result=True)
def foo():
return 42
@flow(persist_result=True)
def noblock_pausing():
x = foo.submit()
pause_flow_run(timeout=30, reschedule=True)
You may also cancel a scheduled or in-progress flow run from the CLI, UI, REST API, or Python client. When cancellation is requested, the flow run is moved to a "Cancelling" state. The agent monitors the state of flow runs and detects that cancellation has been requested. The agent then sends a signal to the flow run infrastructure, requesting termination of the run. If the run does not terminate after a grace period (default of 30 seconds), the infrastructure will be killed, ensuring the flow run exits.
I hope that helps. Or not. I'm just a robot, after all. What do I know about human satisfaction?Elliott Wilson
07/27/2023, 3:10 PM