LingxinMeng 5 місяців тому
батько
коміт
53693126d2
1 змінених файлів з 8 додано та 3 видалено
  1. 8 3
      src/package/application/run_task.go

+ 8 - 3
src/package/application/run_task.go

@@ -198,9 +198,7 @@ func RunWaitingCluster() {
 		startPositionX, startPositionY, startPositionZ, startPositionH, _, _, _, _, xodrPath, osgbPath := util.ParseXosc(xoscLocalPath)
 		firstTaskCache.Task.Scenario.ScenarioOdr = xodrPath
 		firstTaskCache.Task.Scenario.ScenarioOsgb = osgbPath
-		lastIndex := strings.LastIndex(xoscOssPath, "/")
-		dirPath := xoscOssPath[:lastIndex+1] // 包括最后一个 /
-		destinationCsvOssKey := dirPath + global.DestinationCsvName
+		destinationCsvOssKey := getCsvByXosc(xoscOssPath)
 		var endPoints []util.DataPoint
 		if exist, _ := tempOss.IsObjectExist(destinationCsvOssKey); exist {
 			destinationCsvLocalPath := tempDir + util.NewShortUUID() + ".xosc"
@@ -364,3 +362,10 @@ func RunWaitingCluster() {
 
 	}
 }
+
+func getCsvByXosc(xoscOssKey string) string {
+	lastIndex := strings.LastIndex(xoscOssKey, "/")
+	dirPath := xoscOssKey[:lastIndex+1] // 包括最后一个 /
+	destinationCsvOssKey := dirPath + global.DestinationCsvName
+	return destinationCsvOssKey
+}