diff --git a/internal/service/voucher.go b/internal/service/voucher.go index b7e9091..4715a2b 100644 --- a/internal/service/voucher.go +++ b/internal/service/voucher.go @@ -2,6 +2,8 @@ package service import ( "context" + "github.com/go-kratos/kratos/v2/log" + "time" "voucher/internal/biz" "voucher/internal/biz/mixrepos" "voucher/internal/biz/wechatrepo" @@ -31,5 +33,13 @@ func NewVoucherService( func (s *VoucherService) OrderNotice(ctx context.Context) error { - return s.VoucherBiz.OrderNotice(ctx) + start := time.Now() + + err := s.VoucherBiz.OrderNotice(ctx) + + end := time.Now() + elapsed := end.Sub(start) + log.Warnf("订单定时通知,开始执行时间%s,执行结束时间%s,代码块执行耗时: %s", start.Format(time.DateTime), end.Format(time.DateTime), elapsed) + + return err }