diff --git a/server/app/common/command/Crontab.php b/server/app/common/command/Crontab.php index e7dae2c4eff753fde03c81912b86daed66cf4a1d..c09c2cdd93032b8e2e8b88fcc81d555643ba2519 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; }