123456789101112131415161718 |
- package timedTask
- import (
- "context"
- "github.com/gogf/gf/v2/frame/g"
- "github.com/robfig/cron"
- )
- func AutoReturnTask() {
- cr := cron.New()
- //go AutomaticPayment() //首次执行
- go OnlineReturnMoney() //首次执行
- go AutomaticPaymentCollection()
- //cr.AddFunc(g.Cfg().MustGet(context.Background(), "autoReturnTaskTime", "0 */3 * * * ?").String(), AutomaticPayment)
- cr.AddFunc(g.Cfg().MustGet(context.Background(), "onlineReturnMoney", "0 */2 * * * ?").String(), OnlineReturnMoney)
- cr.AddFunc(g.Cfg().MustGet(context.Background(), "protocolNotice.cron", "# 0 2 * * *").String(), OrderProtocolNotice)
- cr.Start()
- }
|