Browse Source

refactor: Modify the master start-stop logic

HeWang 7 tháng trước cách đây
mục cha
commit
18bd52c112
1 tập tin đã thay đổi với 2 bổ sung0 xóa
  1. 2 0
      aarch64/pjibot_guide/control/main.go

+ 2 - 0
aarch64/pjibot_guide/control/main.go

@@ -102,6 +102,7 @@ func stopMasterNode() {
 func main() {
 	localTurnLength := 2  // s
 	cloudTurnLength := 60 // s
+	waitStopLength := 2   // min
 
 	// 更新本地任务状态
 	go pkg.GetLocalStatus(&localStatus, &lastLocalStatus, localTurnLength)
@@ -142,6 +143,7 @@ func main() {
 		} else if localStatus == "idle" {
 			if !renewedFlag && launchedFlag && len(entity.TimeWindowConsumerQueue) == 0 {
 				c_log.GlobalLogger.Info("设备不在运行状态且没有待处理的数据,数采程序关闭 - 开始。")
+				time.Sleep(time.Duration(waitStopLength) * time.Minute)
 				stopMasterNode()
 			}
 			continue