From 4f9caac1b0e55f6aba63d68a6039d8a25a16e620 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=AD=90=E9=93=AD?= Date: Wed, 19 Mar 2025 09:46:26 +0800 Subject: [PATCH] =?UTF-8?q?orderNotice=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/service/cron.go | 5 +++++ 1 file changed, 5 insertions(+) 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 {