This commit is contained in:
ziming 2025-07-02 10:36:39 +08:00
parent f7cb6049df
commit 890f723716
1 changed files with 10 additions and 1 deletions

View File

@ -6,6 +6,7 @@ import (
"fmt" "fmt"
"github.com/go-kratos/kratos/v2/log" "github.com/go-kratos/kratos/v2/log"
"github.com/wechatpay-apiv3/wechatpay-go/services/cashcoupons" "github.com/wechatpay-apiv3/wechatpay-go/services/cashcoupons"
"runtime"
"strconv" "strconv"
"strings" "strings"
"time" "time"
@ -109,7 +110,15 @@ func (this *VoucherBiz) cronWarningBudget(ctx context.Context) error {
}) })
} }
func (this *VoucherBiz) WarningBudget(ctx context.Context, product *bo.ProductBo) error { func (this *VoucherBiz) WarningBudget(ctx context.Context, product *bo.ProductBo) (wErr error) {
defer func() {
if err := recover(); err != nil {
_, file, line, _ := runtime.Caller(1) // 1 表示获取当前调用者的调用信息
log.Errorf("预警查询,发生错误:req:%s,err:%v,file:%s,line:%d", product.BatchNo, err, file, line)
wErr = fmt.Errorf("预警查询,panic: %v", err)
}
}()
if product.WarningBudget == 0 { if product.WarningBudget == 0 {
return fmt.Errorf("no warning budget") return fmt.Errorf("no warning budget")