diff --git a/internal/service/cron.go b/internal/service/cron.go index 492b428..b139ddc 100644 --- a/internal/service/cron.go +++ b/internal/service/cron.go @@ -20,6 +20,11 @@ func (s *VoucherService) CronNotice(ctx context.Context) error { return nil } + if len(c.Command) == 0 { + log.Error("orderNotice定时任务 command is empty") + return nil + } + return s.cron.AddFunc(c.Command, func() { if err := s.Notice(ctx); err != nil {