12345678910111213141516171819202122232425 |
- package init_serve
- import (
- "eta_gn/eta_bridge/global"
- "eta_gn/eta_bridge/services/index_data"
- "github.com/robfig/cron/v3"
- )
- func InitTask() {
- if global.CONFIG.Serve.IsStopTask {
- return
- }
- c := cron.New(cron.WithSeconds())
- if global.CONFIG.Mysql.Binlog.IsListen {
- _, err := c.AddFunc("0 0 0 * * *", index_data.DeleteBeforeTenDayLog)
- if err != nil {
- global.LOG.Error("DeleteBeforeTenDayLog err" + err.Error())
- }
- }
- c.Start()
- }
|