From c97a9189a9ca33cfb09b0e1addfa468107aeb298 Mon Sep 17 00:00:00 2001 From: tommy <3405129587@qq.com> Date: Tue, 2 Jun 2020 15:52:42 +0800 Subject: [PATCH] error --- services/pay/handle.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/services/pay/handle.go b/services/pay/handle.go index 2bc3e38..c7d2a59 100644 --- a/services/pay/handle.go +++ b/services/pay/handle.go @@ -15,7 +15,7 @@ import ( func init() { //go loopOrder() - go utils.HandleTicker(1*time.Hour, HandleReward) // 打赏24小时退款 + go utils.HandleTicker(1*time.Second, HandleReward) // 打赏24小时退款 } var orderDelayQueue = make(chan *models.UserOrder, math.MaxInt8) @@ -247,7 +247,7 @@ func HandleTimeout(order *models.UserOrder) error { func HandleReward() error { result, err := models.GetExpireRewardHistory() if err != nil { - logger.Error("获取过期打赏错误原因", err) + err = fmt.Errorf("获取过期打赏错误原因: %v", err) return err } for _, v := range result { @@ -256,13 +256,14 @@ func HandleReward() error { } _, err := Refund("欧轩互动-打赏过期退款", v.OutTradeNo) if err != nil { - logger.Error("欧轩互动打赏过期退款", v.OutTradeNo) + err = fmt.Errorf("欧轩互动打赏过期退款错误: %v, out_trade_no: %v", err, v.OutTradeNo) return err } v.Status = 4 _, err = models.Update(v.Id, v, "status") if err != nil { - logger.Error("欧轩互动打赏过期状态改变错误") + err = fmt.Errorf("欧轩互动打赏过期状态改变错误: %v, out_trade_no: %v", err, v.OutTradeNo) + return err } } return nil