Forráskód Böngészése

fix: cloud config

HeWang 6 hónapja
szülő
commit
b75e26ca03

+ 1 - 1
aarch64/pjibot_guide/control/main.go

@@ -117,7 +117,7 @@ func main() {
 	go renew()
 
 	// 云端任务状态负责更新配置
-	go pkg.GetCloudConfig(cloudStatus, lastCloudStatus, cloudTurnLength)
+	go pkg.GetCloudConfig(&cloudStatus, &lastCloudStatus, cloudTurnLength)
 
 	for {
 		if launchedFlag { // 当前已启动master节点

+ 2 - 2
aarch64/pjibot_guide/control/pkg/judge_cloud.go

@@ -28,11 +28,11 @@ func GetCloudStatus(cloudStatus *string, lastCloudStatus *string, turnLength int
 	}
 }
 
-func GetCloudConfig(cloudStatus string, lastCloudStatus string, turnLength int) {
+func GetCloudConfig(cloudStatus *string, lastCloudStatus *string, turnLength int) {
 	for {
 		time.Sleep(time.Duration(turnLength) * time.Second)
 		c_log.GlobalLogger.Error("cloudStatus:", cloudStatus)
-		if cloudStatus == "CHANGE" {
+		if *cloudStatus == "CHANGE" {
 			fmt.Println("2")
 			commonConfig.InitPlatformConfig()
 		}