zhangqian
2023-11-01 443fb992699818305e3d7f6885ca7d1d36fbe7cd
crontask/cron_task.go
@@ -7,6 +7,7 @@
   "apsClient/nsq"
   "apsClient/pkg/ecode"
   "apsClient/pkg/logx"
   "apsClient/serf"
   "apsClient/service"
   "fmt"
   "github.com/go-co-op/gocron"
@@ -79,6 +80,9 @@
      s.Every(60).Seconds().Do(SyncProductionProgress) //同步生产数据
      s.Every(30).Seconds().Do(SyncTaskStatus)         //同步任务状态
   }
   s.Every(10).Seconds().Do(QueryClusterStatus) //查询集群节点数量
   s.StartAsync()
   return nil
}
@@ -152,3 +156,9 @@
      logx.Errorf("send pull data msg error:%v, msg:%+v", err.Error(), msg)
   }
}
func QueryClusterStatus() {
   clusterStatus, nodeQuantity := serf.QueryClusterStatusAndNodeQuantity()
   conf.Conf.SerfClusterStatus = clusterStatus
   conf.Conf.ClusterNodeQuantity = nodeQuantity
}