diff --git a/app/Models/Schedule.php b/app/Models/Schedule.php index 432f4d5f8..240873cac 100644 --- a/app/Models/Schedule.php +++ b/app/Models/Schedule.php @@ -122,13 +122,14 @@ class Schedule extends Model * Returns the schedule's execution crontab entry as a string. * * @return \Carbon\CarbonImmutable + * @throws \Exception */ public function getNextRunDate() { $formatted = sprintf('%s %s %s %s %s', $this->cron_minute, $this->cron_hour, $this->cron_day_of_month, $this->cron_month, $this->cron_day_of_week); return CarbonImmutable::createFromTimestamp( - CronExpression::factory($formatted)->getNextRunDate()->getTimestamp() + (new CronExpression($formatted))->getNextRunDate()->getTimestamp() ); } diff --git a/database/migrations/2021_03_21_104718_force_cron_month_field_to_have_value_if_missing.php b/database/migrations/2021_03_21_104718_force_cron_month_field_to_have_value_if_missing.php new file mode 100644 index 000000000..63448c220 --- /dev/null +++ b/database/migrations/2021_03_21_104718_force_cron_month_field_to_have_value_if_missing.php @@ -0,0 +1,31 @@ +