diff --git a/internal/service/wechat_query.go b/internal/service/wechat_query.go index 89a4b4c..687ec5d 100644 --- a/internal/service/wechat_query.go +++ b/internal/service/wechat_query.go @@ -4,6 +4,7 @@ import ( "context" "fmt" "github.com/go-kratos/kratos/v2/log" + "time" "voucher/internal/pkg/rdsmq" ) @@ -30,16 +31,18 @@ func (s *VoucherService) GetConfig() *rdsmq.ConsumeConfig { } } -func (s *VoucherService) Handle(ctx context.Context, msg string) error { +func (s *VoucherService) Handle(ctx context.Context, batchNo string) error { - if msg == "" { + if batchNo == "" { s.logHelper.Errorf("RdsMQ keySend error: batchNo is empty") return nil } - if err := s.VoucherBiz.WechatQuery(ctx, msg); err != nil { + start := time.Now() + if err := s.VoucherBiz.WechatQuery(ctx, batchNo); err != nil { s.logHelper.Error(err) } + log.Warnf("处理耗时:%s,batchNo:%s", time.Now().Sub(start).String(), batchNo) return nil }