1
0
mirror of https://github.com/1Panel-dev/1Panel.git synced 2025-01-19 08:19:15 +08:00

fix: 解决删除应用失败的BUG

This commit is contained in:
zhengkunwang223 2022-12-06 15:59:25 +08:00 committed by zhengkunwang223
parent 3f02358708
commit 9b5ea3f317
2 changed files with 7 additions and 1 deletions

View File

@ -129,7 +129,7 @@ func (a AppInstallService) Operate(req dto.AppInstallOperate) error {
}
install.Status = constant.Running
case dto.Down:
out, err := compose.Down(dockerComposePath)
out, err := compose.Stop(dockerComposePath)
if err != nil {
return handleErr(install, err, out)
}

View File

@ -13,6 +13,12 @@ func Up(filePath string) (string, error) {
}
func Down(filePath string) (string, error) {
cmd := exec.Command("docker-compose", "-f", filePath, "down")
stdout, err := cmd.CombinedOutput()
return string(stdout), err
}
func Stop(filePath string) (string, error) {
cmd := exec.Command("docker-compose", "-f", filePath, "stop")
stdout, err := cmd.CombinedOutput()
return string(stdout), err