mirror of
https://github.com/kongyuebin1/dongfeng-pay.git
synced 2025-12-13 20:49:57 +08:00
由gopath形式改为module
This commit is contained in:
32
microservice/pay_for/payfor.go
Normal file
32
microservice/pay_for/payfor.go
Normal file
@@ -0,0 +1,32 @@
|
||||
/***************************************************
|
||||
** @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分钟没有执行了.........")
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user