package services import ( "github.com/astaxie/beego/toolbox" ) func Task() { //报告历史访问次数 reportViewTimes := toolbox.NewTask("reportViewTimes", "0 0 20 * * 4 ", ReportViewTimes) toolbox.AddTask("reportViewTimes", reportViewTimes) //报告访问详情 reportViewDetail := toolbox.NewTask("reportViewDetail", "0 0 20 * * 4 ", ReportViewDetail) toolbox.AddTask("reportViewDetail", reportViewDetail) toolbox.StartTask() }