From eda082b08262171fe406d95ad4db8784fa7e5451 Mon Sep 17 00:00:00 2001
From: liuxiaolong <736321739@qq.com>
Date: 星期五, 20 十二月 2019 16:48:36 +0800
Subject: [PATCH] test

---
 service/SysService.go |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/service/SysService.go b/service/SysService.go
index 8415150..ab26ee4 100644
--- a/service/SysService.go
+++ b/service/SysService.go
@@ -124,19 +124,20 @@
 	}
 	defer file.Close()
 	writer := bufio.NewWriter(file)
-	chunkData := make([]byte, arg.CurrentChunkSize)
+	chunkData := make([]byte, arg.Header.Size)
 	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)
+	if err = writer.Flush(); err != nil {
+		logger.Debug("write flush err:",err)
+	}
 	isComplete := false
 	dirFiles, _ := ioutil.ReadDir(fileTmpPath)
 	if dirFiles != nil && len(dirFiles) == arg.TotalChunks {
@@ -259,7 +260,7 @@
 	//鍒ゆ柇鏇存柊鍖呴噷鏄惁鏈夎ˉ涓佽剼鏈紝濡傛灉鏈夊垯鎵ц锛屽惁鍒欐墽琛寀pdatePatch.sh
 	updateCmd := fmt.Sprintf("./updatePatch.sh %s %s %s &",unZipPath,zipFilePath,configPatchPath+"/"+identifier)
 	if util.Exists(unZipPath+"upgrade.sh") {
-		updateCmd = fmt.Sprintf("%supgrade.sh %s %s %s &",unZipPath,unZipPath,zipFilePath,configPatchPath+"/"+identifier)
+		updateCmd = fmt.Sprintf("%supgrade.sh %s %s %s",unZipPath,unZipPath,zipFilePath,configPatchPath+"/"+identifier)
 	}
 	//2.鏇存柊绯荤粺
 	b,err := ExecCmd(updateCmd)

--
Gitblit v1.8.0