LingxinMeng vor 10 Monaten
Ursprung
Commit
1edf05c16f

+ 2 - 1
aarch64/kinglong/common/service/rosbag_upload.go

@@ -39,7 +39,7 @@ outLoop:
 		if waitLength == 0 {
 			continue outLoop
 		}
-		c_log.GlobalLogger.Infof("待处理窗口个数为:%v", len(entity.TimeWindowConsumerQueue))
+
 		// 1 获取即将处理的窗口
 		currentTimeWindow := entity.TimeWindowConsumerQueue[0]
 		entity.RemoveHeadOfTimeWindowConsumerQueue()
@@ -152,6 +152,7 @@ outLoop:
 		}
 		// 删除本地所有已上传的bag文件
 		c_log.GlobalLogger.Infof("结束处理窗口,【Label】=%v,【FaultTime】=%v,【Length】=%v", currentTimeWindow.Labels, currentTimeWindow.FaultTime, currentTimeWindow.Length)
+		c_log.GlobalLogger.Infof("待处理窗口个数为:%v", len(entity.TimeWindowConsumerQueue))
 		if err := util.RemoveDir(dir); err != nil {
 			continue outLoop
 		}

+ 2 - 1
aarch64/pjibot_delivery/common/service/rosbag_upload.go

@@ -41,7 +41,7 @@ outLoop:
 		if waitLength == 0 {
 			continue outLoop
 		}
-		c_log.GlobalLogger.Infof("待处理窗口个数为:%v", len(entity.TimeWindowConsumerQueue))
+
 		// 1 获取即将处理的窗口
 		currentTimeWindow := entity.TimeWindowConsumerQueue[0]
 		entity.RemoveHeadOfTimeWindowConsumerQueue()
@@ -152,6 +152,7 @@ outLoop:
 
 		// 删除本地所有已上传的bag文件
 		c_log.GlobalLogger.Infof("结束处理窗口,【Lable】=%v,【FaultTime】=%v,【Length】=%v", currentTimeWindow.Labels, currentTimeWindow.FaultTime, currentTimeWindow.Length)
+		c_log.GlobalLogger.Infof("待处理窗口个数为:%v", len(entity.TimeWindowConsumerQueue))
 		if err = util.RemoveDir(dir); err != nil {
 			continue outLoop
 		}

+ 2 - 1
aarch64/pjibot_guide/common/service/rosbag_upload.go

@@ -41,7 +41,7 @@ outLoop:
 		if waitLength == 0 {
 			continue outLoop
 		}
-		c_log.GlobalLogger.Infof("待处理窗口个数为:%v", len(entity.TimeWindowConsumerQueue))
+
 		// 1 获取即将处理的窗口
 		currentTimeWindow := entity.TimeWindowConsumerQueue[0]
 		entity.RemoveHeadOfTimeWindowConsumerQueue()
@@ -152,6 +152,7 @@ outLoop:
 
 		// 删除本地所有已上传的bag文件
 		c_log.GlobalLogger.Infof("结束处理窗口,【Lable】=%v,【FaultTime】=%v,【Length】=%v", currentTimeWindow.Labels, currentTimeWindow.FaultTime, currentTimeWindow.Length)
+		c_log.GlobalLogger.Infof("待处理窗口个数为:%v", len(entity.TimeWindowConsumerQueue))
 		if err = util.RemoveDir(dir); err != nil {
 			continue outLoop
 		}

+ 2 - 1
aarch64/pjibot_patrol/common/service/rosbag_upload.go

@@ -41,7 +41,7 @@ outLoop:
 		if waitLength == 0 {
 			continue outLoop
 		}
-		c_log.GlobalLogger.Infof("待处理窗口个数为:%v", len(entity.TimeWindowConsumerQueue))
+
 		// 1 获取即将处理的窗口
 		currentTimeWindow := entity.TimeWindowConsumerQueue[0]
 		entity.RemoveHeadOfTimeWindowConsumerQueue()
@@ -152,6 +152,7 @@ outLoop:
 
 		// 删除本地所有已上传的bag文件
 		c_log.GlobalLogger.Infof("结束处理窗口,【Lable】=%v,【FaultTime】=%v,【Length】=%v", currentTimeWindow.Labels, currentTimeWindow.FaultTime, currentTimeWindow.Length)
+		c_log.GlobalLogger.Infof("待处理窗口个数为:%v", len(entity.TimeWindowConsumerQueue))
 		if err = util.RemoveDir(dir); err != nil {
 			continue outLoop
 		}

+ 1 - 3
aarch64/pjisuv/common/service/rosbag_upload.go

@@ -41,7 +41,6 @@ outLoop:
 		if waitLength == 0 {
 			continue outLoop
 		}
-		c_log.GlobalLogger.Infof("待处理窗口个数为:%v", len(entity.TimeWindowConsumerQueue))
 		// 1 获取即将处理的窗口
 		currentTimeWindow := entity.TimeWindowConsumerQueue[0]
 		entity.RemoveHeadOfTimeWindowConsumerQueue()
@@ -132,10 +131,9 @@ outLoop:
 				//	continue outLoop
 				//}
 				commonUtil.WriteStringToFile(callBackJson, dir+"callback.json")
-
 			}
 			c_log.GlobalLogger.Infof("结束处理窗口,【Label】=%v,【FaultTime】=%v,【Length】=%v", currentTimeWindow.Labels, currentTimeWindow.FaultTime, currentTimeWindow.Length)
-
+			c_log.GlobalLogger.Infof("待处理窗口个数为:%v", len(entity.TimeWindowConsumerQueue))
 		}
 
 	}

+ 6 - 4
common/domain/d_service.go

@@ -4,6 +4,7 @@ import (
 	"cicv-data-closedloop/common/config/c_log"
 	"cicv-data-closedloop/common/entity"
 	"cicv-data-closedloop/common/util"
+	"os"
 	"strings"
 	"time"
 )
@@ -12,11 +13,12 @@ func MoveFromDataToCopy(faultTime string, bagDataDir string, sourceBag string, b
 	dir := GetCopyDir(bagCopyDir, faultTime)
 	util.CreateDir(dir)
 	targetBag := strings.Replace(sourceBag, bagDataDir, dir, 1)
-	var copyCommand []string
-	copyCommand = append(copyCommand, sourceBag)
-	copyCommand = append(copyCommand, targetBag)
-	_, _, _ = util.Execute("mv", copyCommand...)
+	err := os.Rename(sourceBag, targetBag)
+	if err != nil {
+		return
+	}
 	c_log.GlobalLogger.Infof("移动bag包 【%v】->【%v】", sourceBag, targetBag)
+
 }
 
 func GetCopyDir(bagDataDir string, faultTime string) string {