fix(plugin): set status to failed if there are node_errors
This commit is contained in:
		
							parent
							
								
									824ce16b4e
								
							
						
					
					
						commit
						744a222e26
					
				@ -116,15 +116,16 @@ async def comfy_deploy_run(request):
 | 
				
			|||||||
        return web.Response(status=500, reason=f"{error_type}: {e}, {stack_trace_short}")
 | 
					        return web.Response(status=500, reason=f"{error_type}: {e}, {stack_trace_short}")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    status = 200
 | 
					    status = 200
 | 
				
			||||||
    if "error" in res:
 | 
					    # if "error" in res:
 | 
				
			||||||
        status = 400
 | 
					    #     status = 400
 | 
				
			||||||
        await update_run_with_output(prompt_id, {
 | 
					    #     await update_run_with_output(prompt_id, {
 | 
				
			||||||
            "error": {
 | 
					    #         "error": {
 | 
				
			||||||
                **res
 | 
					    #             **res
 | 
				
			||||||
            }
 | 
					    #         }
 | 
				
			||||||
        })
 | 
					    #     })
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    if "node_errors" in res and res["node_errors"]:
 | 
					    if "node_errors" in res and res["node_errors"]:
 | 
				
			||||||
 | 
					        # Even tho there are node_errors it can still be run
 | 
				
			||||||
        status = 400
 | 
					        status = 400
 | 
				
			||||||
        await update_run_with_output(prompt_id, {
 | 
					        await update_run_with_output(prompt_id, {
 | 
				
			||||||
            "error": {
 | 
					            "error": {
 | 
				
			||||||
@ -132,6 +133,10 @@ async def comfy_deploy_run(request):
 | 
				
			|||||||
            }
 | 
					            }
 | 
				
			||||||
        })
 | 
					        })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        # When there are critical errors, the prompt is actually not run
 | 
				
			||||||
 | 
					        if "error" in res:
 | 
				
			||||||
 | 
					            await update_run(prompt_id, Status.FAILED)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return web.json_response(res, status=status)
 | 
					    return web.json_response(res, status=status)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
sockets = dict()
 | 
					sockets = dict()
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user