|
@@ -3,10 +3,13 @@ package pkg
|
|
|
import (
|
|
|
commonConfig "cicv-data-closedloop/aarch64/pjibot_guide/common/config"
|
|
|
"cicv-data-closedloop/common/config/c_log"
|
|
|
- "fmt"
|
|
|
"time"
|
|
|
)
|
|
|
|
|
|
+var (
|
|
|
+ maxRetryCount = 10
|
|
|
+)
|
|
|
+
|
|
|
// UN_CHANGE 没有新的任务
|
|
|
// CHANGE 有新的任务
|
|
|
// NONE 设备没有配置任务
|
|
@@ -31,10 +34,12 @@ func GetCloudStatus(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" {
|
|
|
- fmt.Println("2")
|
|
|
- commonConfig.InitPlatformConfig()
|
|
|
+ c_log.GlobalLogger.Error("cloudStatus:", *cloudStatus)
|
|
|
+ if commonConfig.CheckPlatformConfigStatus(maxRetryCount) {
|
|
|
+ c_log.GlobalLogger.Info("查询到数据闭环平台有配置任务。")
|
|
|
+ commonConfig.InitPlatformConfig()
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|