judge_cloud.go 602 B

1234567891011121314151617181920212223
  1. package pkg
  2. import (
  3. commonConfig "cicv-data-closedloop/aarch64/pjibot_guide/common/config"
  4. "cicv-data-closedloop/common/config/c_log"
  5. "time"
  6. )
  7. // UN_CHANGE 没有新的任务
  8. // CHANGE 有新的任务
  9. // NONE 设备没有配置任务
  10. func GetCloudStatus(status *string, turnLength int) {
  11. // 轮询云端任务状态
  12. for {
  13. time.Sleep(time.Duration(turnLength) * time.Second)
  14. taskStatus, err := commonConfig.GetStatus(commonConfig.PlatformConfig.TaskConfigId)
  15. if err != nil {
  16. c_log.GlobalLogger.Error("获取云端配置status失败:", err)
  17. continue
  18. }
  19. *status = taskStatus
  20. }
  21. }