From 67068d7d2e888a6726ce7f1311d123135224637d Mon Sep 17 00:00:00 2001 From: liuxiaolong <736321739@qq.com> Date: 星期四, 19 十二月 2019 15:55:14 +0800 Subject: [PATCH] fix updatePatch,add & --- service/SysService.go | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-) diff --git a/service/SysService.go b/service/SysService.go index a13458c..c50339f 100644 --- a/service/SysService.go +++ b/service/SysService.go @@ -201,12 +201,15 @@ unZipPath := configPatchPath+"/"+identifier+"_basic/" if util.Exists(unZipPath) { //姝ょ増鏈凡缁忔洿鏂拌繃 - return true - } else { - if !util.CreateDirectory(unZipPath) { + rmErr := os.RemoveAll(unZipPath) + if rmErr !=nil { return false } } + if !util.CreateDirectory(unZipPath) { + return false + } + zipFilePath := configPatchPath+"/"+identifier+ext err := util.UnZip(zipFilePath, unZipPath) if err !=nil { @@ -215,7 +218,7 @@ } //2.鏇存柊绯荤粺 var cmd *exec.Cmd - updateCmd := fmt.Sprintf("setsid ./updatePatch.sh %s %s %s",unZipPath,zipFilePath,configPatchPath+"/"+identifier) + updateCmd := fmt.Sprintf("./updatePatch.sh %s %s %s &",unZipPath,zipFilePath,configPatchPath+"/"+identifier) cmd = exec.Command("/bin/sh","-c", updateCmd) if b, err := cmd.Output(); err != nil { logger.Debug("updatePatch err:",err,"result:",string(b)) -- Gitblit v1.8.0