Merge pull request #807 from awslabs/async_release

feat: Async release improved
pull/808/head
Elon N 2024-06-11 10:11:37 +08:00 committed by GitHub
commit 55c46bf2c3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 16 additions and 9 deletions

View File

@ -1050,6 +1050,15 @@ if is_on_ec2:
return web.Response(status=200, content_type='application/json',
body=json.dumps({"result": False, "message": f"name is required"}))
name = json_data['name']
if name == 'default' or name == 'local':
return web.Response(status=200, content_type='application/json',
body=json.dumps({"result": False, "message": f"{name} is not allowed"}))
if os.getenv('WORKFLOW_NAME') == name:
return web.Response(status=200, content_type='application/json',
body=json.dumps({"result": False, "message": "can not delete current workflow"}))
data = {
"workflow_name_list": [name],
}
@ -1058,7 +1067,7 @@ if is_on_ec2:
print(response)
return web.Response(status=200, content_type='application/json',
body=json.dumps({"result": True, "message": "success"}))
body=json.dumps({"result": True, "message": "Workflow will be deleted soon"}))
except Exception as e:
logger.info(e)
return web.Response(status=500, content_type='application/json',

View File

@ -349,15 +349,13 @@ if [ -n "$ON_EC2" ]; then
cd /home/ubuntu/ComfyUI || exit 1
if [ "$WORKFLOW_NAME" = "default" ]; then
if [ -f "/comfy_proxy.py" ]; then
cp -f /comfy_proxy.py /home/ubuntu/ComfyUI/custom_nodes/
fi
if [ -f "/comfy_proxy.py" ]; then
cp -f /comfy_proxy.py /home/ubuntu/ComfyUI/custom_nodes/
fi
if [ -d "/ComfyUI-AWS-Extension" ]; then
rm -rf /home/ubuntu/ComfyUI/custom_nodes/ComfyUI-AWS-Extension
cp -r /ComfyUI-AWS-Extension /home/ubuntu/ComfyUI/custom_nodes/
fi
if [ -d "/ComfyUI-AWS-Extension" ]; then
rm -rf /home/ubuntu/ComfyUI/custom_nodes/ComfyUI-AWS-Extension
cp -r /ComfyUI-AWS-Extension /home/ubuntu/ComfyUI/custom_nodes/
fi
rm -rf web/extensions/ComfyLiterals