https://prefect.io logo
Title
v

Vadym Dytyniak

04/05/2023, 8:15 AM
Hi. In Prefect 2 I use context manager instead of ResourceManager available in Prefect 1. It works fine except for the case when the flow was cancelled. After flow is cancelled my resource is still running as finally block wasn't executed. Do you have any ideas how to shutdown the resource in case of cancel action? Thanks.
👀 1
s

Sahil Rangwala

04/06/2023, 5:08 PM
You can set up an automation to pause a work queue based on a flow cancellation to help halt any resources
v

Vadym Dytyniak

04/07/2023, 7:31 AM
Thanks, but not sure it works for me. I have to shutdown the cluster created in the flow.