dongfeng-pay/microservice/pay_for/payfor.go

33 lines
938 B
Go
Raw Normal View History

2021-04-27 15:33:49 +08:00
/***************************************************
** @Desc : 处理代付问题
** @Time : 2019/11/29 14:07
** @Author : yuebin
** @File : payfor
** @Last Modified by : yuebin
** @Last Modified time: 2019/11/29 14:07
** @Software: GoLand
****************************************************/
package pay_for
import (
"github.com/astaxie/beego/logs"
"microservice/common"
controller "microservice/supplier"
"time"
)
func PayForInit() {
payForIntervalTimer := time.NewTimer(time.Duration(common.PAYFOR_INTERVAL * time.Second))
for {
select {
case <-payForIntervalTimer.C:
logs.Info("代付小程序开始执行任务......")
payForIntervalTimer = time.NewTimer(time.Duration(common.PAYFOR_INTERVAL * time.Minute))
controller.SolvePayForConfirm()
controller.SolvePayFor()
case <-time.After(time.Duration(10 * time.Minute)):
logs.Notice("代付小程序已经10分钟没有执行了.........")
}
}
}