diff --git a/catch/monitor/command/ScheduleCommand.php b/catch/monitor/command/ScheduleCommand.php index 602bbad..ecaee21 100644 --- a/catch/monitor/command/ScheduleCommand.php +++ b/catch/monitor/command/ScheduleCommand.php @@ -105,7 +105,8 @@ class ScheduleCommand extends Command return true; } - $can = date('Y-m-d H:i', CronExpression::factory(trim($command->cron)) + $can = date('Y-m-d H:i', + (new CronExpression(trim($command->cron))) ->getNextRunDate(date('Y-m-d H:i:s'), 0, true) ->getTimestamp()) == date('Y-m-d H:i', time()); diff --git a/composer.json b/composer.json index 19f759d..26915c8 100644 --- a/composer.json +++ b/composer.json @@ -24,7 +24,7 @@ "thans/tp-jwt-auth": "1.1", "overtrue/wechat": "^4.2", "phpoffice/phpspreadsheet": "^1.12", - "dragonmantank/cron-expression": "^3.0", + "dragonmantank/cron-expression": "3.1", "symfony/finder": "^4.4", "ext-json": "*", "overtrue/easy-sms": "^1.1",