File tree 1 file changed +6
-1
lines changed
1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 19
19
WorkflowRecordWithThumbnailDTO ,
20
20
WorkflowWithoutID ,
21
21
)
22
+ from invokeai .app .services .workflow_thumbnails .workflow_thumbnails_common import WorkflowThumbnailFileNotFoundException
22
23
23
24
IMAGE_MAX_AGE = 31536000
24
25
workflows_router = APIRouter (prefix = "/v1/workflows" , tags = ["workflows" ])
@@ -65,7 +66,11 @@ async def delete_workflow(
65
66
workflow_id : str = Path (description = "The workflow to delete" ),
66
67
) -> None :
67
68
"""Deletes a workflow"""
68
- ApiDependencies .invoker .services .workflow_thumbnails .delete (workflow_id )
69
+ try :
70
+ ApiDependencies .invoker .services .workflow_thumbnails .delete (workflow_id )
71
+ except WorkflowThumbnailFileNotFoundException :
72
+ # It's OK if the workflow has no thumbnail file. We can still delete the workflow.
73
+ pass
69
74
ApiDependencies .invoker .services .workflow_records .delete (workflow_id )
70
75
71
76
You can’t perform that action at this time.
0 commit comments