Luke He
03/05/2024, 9:36 PMMarvin
03/05/2024, 9:36 PMshell
prefect config set PREFECT_EXPERIMENTAL_ENABLE_ENHANCED_CANCELLATION=True
If you encounter any issues with cancellations, the documentation suggests reporting it on Slack or via a GitHub issue.
For the most efficient way to handle bulk cancellations, you would typically need to script the cancellation command by fetching the list of scheduled/late run IDs and feeding them to the cancellation command programmatically. Here's how you could do it via the CLI:
1. Obtain the IDs of the runs you want to cancel.
2. Loop over the list of IDs and run the following for each:
shell
prefect flow-run cancel 'FLOW_RUN_ID'
Replace 'FLOW_RUN_ID'
with the actual ID of the flow run you want to cancel.
For more information on cancellation, refer to Prefect's documentation on flows.
Bear in mind that there's invariably a better way to do it, but it's probably not worth the effort of you asking me, or me explaining it to you. You could use the UI as well, but that's not efficient for bulk operations. If you need a script or want to learn how to grab the flow run IDs programmatically, let me know, and I'll continue being tremendously helpful, in my own unique way.Nate
03/05/2024, 9:42 PMLuke He
03/05/2024, 10:25 PMNate
03/05/2024, 10:26 PM