Tobias
12/19/2022, 10:44 AMTobias
12/19/2022, 10:47 AMFailed to delete deployments
and if I delete with API I get a TimeoutError.
I’ve searched Slack and online, but haven’t found anything similar.Tobias
12/19/2022, 10:48 AMAnna Geller
Anna Geller
Tobias
12/20/2022, 10:45 AMmaintainance
was set to 10s and the que crashed somehow, there are 1000s (99244) of pending jobs for a que that does not exist anymore.
I cant seem to find a way to bulk select and delete Flow Runs in the UI?
prefect flow-run delete
does not seems to allow any deletion based on tags or flow name?Anna Geller
Anna Geller
Anna Geller
Anna Geller
import asyncio
from prefect import get_client
from prefect.orion.schemas.filters import DeploymentFilter
async def remove_runs_from_a_given_deployment_id(id_):
client = get_client()
runs = await client.read_flow_runs(
deployment_filter=DeploymentFilter(id={"any_": [id_]})
)
for run in runs:
print(f"Deleting run: {run.name}")
await client.delete_flow_run(run.id)
print(f"Run with UUID {run.id} deleted")
if __name__ == "__main__":
deployment_id = "bd413bc3-ae3b-49eb-bddf-56a6c4663af2"
asyncio.run(remove_runs_from_a_given_deployment_id(deployment_id))
Tobias
12/21/2022, 1:26 PMclient
only has a method for deleting one flow run at the time.
Is there a rate limit on the API?Anna Geller
Anna Geller
Tobias
12/21/2022, 1:40 PMTobias
12/21/2022, 1:41 PMfor i in {1..500}; do python remove_flow_runs.py; done
then 😇Tobias
12/21/2022, 1:44 PMAnna Geller