From a11899cbef7d87fd0b61c7b6e51447e858c4e899 Mon Sep 17 00:00:00 2001 From: liuxiaolong <736321739@qq.com> Date: 星期五, 20 十二月 2019 16:24:56 +0800 Subject: [PATCH] add log --- service/SysService.go | 15 ++++++++++++++- 1 files changed, 14 insertions(+), 1 deletions(-) diff --git a/service/SysService.go b/service/SysService.go index 4e57f6b..8415150 100644 --- a/service/SysService.go +++ b/service/SysService.go @@ -124,17 +124,19 @@ } defer file.Close() writer := bufio.NewWriter(file) - chunkData := make([]byte, arg.Header.Size) + chunkData := make([]byte, arg.CurrentChunkSize) n, err := (*arg.File).ReadAt(chunkData, 0) if n ==0 || err !=nil { logger.Debug("read chunkData err:",err,"n:",n) return false } + logger.Debug("read chunkData len:",n) nn, err2 := writer.Write(chunkData) if nn ==0 || err2 !=nil { logger.Debug("write chunkData err:",err2,"nn:",nn) return false } + logger.Debug("write chunkData len:",nn) isComplete := false dirFiles, _ := ioutil.ReadDir(fileTmpPath) if dirFiles != nil && len(dirFiles) == arg.TotalChunks { @@ -243,6 +245,17 @@ logger.Debug("UnZip err:",err,"zipFile:",zipFilePath) return false } + + //濡傛灉閫氱敤鑴氭湰鏈夋洿鏂帮紝鍒欐洿鏂伴�氱敤鑴氭湰 + if util.Exists(unZipPath+"updatePatch.sh") { + cpStr := fmt.Sprintf("cp %s /opt/vasystem/bin",unZipPath+"updatePatch.sh") + b, err := ExecCmd(cpStr) + if err != nil { + logger.Debug("cp updatePatch.sh to bin err:",err,"result:",string(b)) + return false + } + } + //鍒ゆ柇鏇存柊鍖呴噷鏄惁鏈夎ˉ涓佽剼鏈紝濡傛灉鏈夊垯鎵ц锛屽惁鍒欐墽琛寀pdatePatch.sh updateCmd := fmt.Sprintf("./updatePatch.sh %s %s %s &",unZipPath,zipFilePath,configPatchPath+"/"+identifier) if util.Exists(unZipPath+"upgrade.sh") { -- Gitblit v1.8.0