task_gn.go 474 B

123456789101112131415161718192021
  1. package services
  2. import (
  3. "eta_gn/eta_task/services/eta_bridge"
  4. "eta_gn/eta_task/utils"
  5. "github.com/beego/beego/v2/task"
  6. )
  7. func GnTask() {
  8. // 指标相关
  9. // 每小时同步一次指标列表
  10. if utils.SyncIndexPath != `` {
  11. syncIndexTime := utils.SyncIndexTime
  12. if syncIndexTime == `` {
  13. syncIndexTime = "0 0 * * * *"
  14. }
  15. syncIndex := task.NewTask("syncIndex", syncIndexTime, eta_bridge.SyncGnIndex)
  16. task.AddTask("定时同步指标信息", syncIndex)
  17. }
  18. }