From ea27b613d63571c557b8f1dbb5d5dd6d273a706f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=81=A5=E4=B9=90?= <690712575@qq.com> Date: Tue, 7 Nov 2023 11:43:59 +0000 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=8F=AF=E8=83=BD=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E8=BF=90=E8=A1=8C=E5=A4=AA=E6=97=A7=E4=BC=9A=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E8=BE=B9=E7=95=8C=E5=80=BC=E8=B6=85=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E6=84=8F=E5=A4=96=E7=9A=84=E6=89=A7=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 陈健乐 <690712575@qq.com> --- server/app/common/command/Crontab.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/app/common/command/Crontab.php b/server/app/common/command/Crontab.php index e7dae2c4e..c09c2cdd9 100644 --- a/server/app/common/command/Crontab.php +++ b/server/app/common/command/Crontab.php @@ -41,11 +41,12 @@ class Crontab extends Command if (empty($lists)) { return false; } + $time = time(); foreach ($lists as $item) { $nextTime = (new CronExpression($item['expression'])) ->getNextRunDate($item['last_time']) ->getTimestamp(); - if ($nextTime > time()) { + if ($nextTime > $time) { // 未到时间,不执行 continue; } -- Gitee