123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- package services
- import (
- "eta/eta_task/services/eta_bridge"
- "eta/eta_task/utils"
- "github.com/beego/beego/v2/task"
- )
- func XyTask() {
- if utils.IsXy != "1" {
- return
- }
- //eta_bridge.SyncIndexList(nil)
- //eta_bridge.SyncIndexValueList(nil)
- //eta_bridge.SyncClassifyList(nil)
- //eta_bridge.SyncEdbClassifyList(nil)
- //eta_bridge.SyncIndex(nil)
- //return
- // 用户信息
- if utils.SyncUserPath != `` {
- syncUserTime := utils.SyncUserTime
- if syncUserTime == `` {
- syncUserTime = "0 0 * * * *"
- }
- // 每小时同步一次用户列表
- syncUser := task.NewTask("syncUser", syncUserTime, eta_bridge.SyncUser)
- task.AddTask("定时同步用户账号", syncUser)
- }
- // 指标相关
- if utils.SyncIndexPath != `` {
- // 每天同步一次指标与分类关系的列表
- syncIndexClassifyTime := utils.SyncIndexClassifyTime
- if syncIndexClassifyTime == `` {
- syncIndexClassifyTime = "0 0 0 * * *"
- }
- syncIndexClassify := task.NewTask("syncIndexClassify", syncIndexClassifyTime, eta_bridge.SyncClassifyList)
- task.AddTask("定时同步指标与分类关系", syncIndexClassify)
- // 每小时同步一次指标列表
- syncIndexTime := utils.SyncIndexTime
- if syncIndexTime == `` {
- syncIndexTime = "0 0 * * * *"
- }
- syncIndex := task.NewTask("syncIndex", syncIndexTime, eta_bridge.SyncIndex)
- task.AddTask("定时同步指标信息", syncIndex)
- }
- if utils.SyncCrmIndexPath != `` {
- // 每小时同步一次指标列表
- syncIndexTime := utils.SyncCrmIndexTime
- if syncIndexTime == `` {
- syncIndexTime = "0 0 * * * *"
- }
- syncXyCrmIndex := task.NewTask("syncXyCrmIndex", syncIndexTime, eta_bridge.SyncXyCrmIndex)
- task.AddTask("定时同步crm指标信息", syncXyCrmIndex)
- }
- }
|