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) } }