From 82cffdfe29459ab251cbb119696b99cafffab94d Mon Sep 17 00:00:00 2001 From: ayflying Date: Mon, 19 May 2025 11:31:39 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B2=A1=E6=9C=89=E9=85=8D=E7=BD=AE=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=BA=93=EF=BC=8C=E4=B8=8D=E6=89=A7=E8=A1=8C=E8=AE=A1?= =?UTF-8?q?=E5=88=92=E4=BB=BB=E5=8A=A1=EF=BC=8C=E9=A2=84=E9=98=B2=E6=8A=A5?= =?UTF-8?q?=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/logic/systemCron/systemCron.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/logic/systemCron/systemCron.go b/internal/logic/systemCron/systemCron.go index 54ddebb..0cf5b9c 100644 --- a/internal/logic/systemCron/systemCron.go +++ b/internal/logic/systemCron/systemCron.go @@ -136,6 +136,10 @@ func (s *sSystemCron) AddCronV2(typ v1.CronType, _func func(context.Context) err // @receiver s // @return err func (s *sSystemCron) StartCron() (err error) { + //如果没有数据库配置,跳过计划任务执行 + if g.Cfg().MustGet(gctx.New(), "database") == nil { + return + } //预防重复启动 if startTime != nil { return