package services import ( "eta_gn/eta_task/services/eta_bridge" "eta_gn/eta_task/utils" "github.com/beego/beego/v2/task" ) func GnTask() { // 初始化一次 //fmt.Println(eta_bridge.SyncGnIndex(nil)) //fmt.Println(eta_bridge.InitRefreshEdb(nil)) // 指标相关 // 每小时同步一次指标列表 if utils.SyncIndexPath != `` { syncIndexTime := utils.SyncIndexTime if syncIndexTime == `` { syncIndexTime = "0 0 * * * *" } syncIndex := task.NewTask("syncIndex", syncIndexTime, eta_bridge.SyncGnIndex) task.AddTask("定时同步指标信息", syncIndex) } //// 每小时同步一次OA用户信息 //syncOaUserTime := utils.SyncOaUserTime //if syncOaUserTime == `` { // syncOaUserTime = "0 0 * * * *" //} //syncOaUser := task.NewTask("syncGnUser", syncOaUserTime, eta_bridge.SyncGnUser) //task.AddTask("定时同步OA用户信息", syncOaUser) // 每天6点,12点,18点,半点开始每10分钟同步一次 syncDataNodeTime := utils.SyncDataNodeTime if syncDataNodeTime == `` { syncDataNodeTime = "0 30/10 6,12,18 * * *" } syncDataNode := task.NewTask("syncDataNode", syncDataNodeTime, eta_bridge.SyncDataNode) task.AddTask("定时同步数据节点观点数据", syncDataNode) // 每分钟检查一下是否需要发送报告撰写提醒 sendReportWriteRemind := task.NewTask("sendReportWriteRemind", "0 */1 * * * *", ReportWriteRemind) task.AddTask("定时发送报告撰写提醒", sendReportWriteRemind) }