From 0c7571cb7bf7f8ac4f20f3279b136743a33f0ed2 Mon Sep 17 00:00:00 2001 From: ziming Date: Thu, 22 May 2025 17:29:34 +0800 Subject: [PATCH] kx time out 10s add log --- internal/biz/wechat_notify.go | 4 +++- internal/data/mixrepoimpl/kx.go | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/internal/biz/wechat_notify.go b/internal/biz/wechat_notify.go index 601f562..0e59972 100644 --- a/internal/biz/wechat_notify.go +++ b/internal/biz/wechat_notify.go @@ -75,7 +75,9 @@ func (v *VoucherBiz) useLog(ctx context.Context, order *bo.OrderBo, req *bo.Wech } } - return v.wxToBBUse(ctx, order, req) + _ = v.wxToBBUse(ctx, order, req) + + return nil } func (v *VoucherBiz) used(ctx context.Context, order *bo.OrderBo) error { diff --git a/internal/data/mixrepoimpl/kx.go b/internal/data/mixrepoimpl/kx.go index 68e7d08..af51b19 100644 --- a/internal/data/mixrepoimpl/kx.go +++ b/internal/data/mixrepoimpl/kx.go @@ -49,12 +49,12 @@ func (this *KxMixRepoImpl) Request(ctx context.Context, req *kog.Notice) error { if err != nil { return err } - //fmt.Printf("请求kx,url:%s,reqBody:%s", url, string(body)) + start := time.Now() _, bodyBytes, err := request.POST(ctx, url, body, this.options) if err != nil { - log.Errorf("请求kx,url:%s,reqBody:%s,respBody:%s,err:%v", url, string(body), string(bodyBytes), err) - return nil + log.Errorf("请求kx发生错误,耗时:%s,url:%s,reqBody:%s,respBody:%s,err:%v", time.Now().Sub(start).String(), url, string(body), string(bodyBytes), err) + return err } return nil