Scheduing progress
This commit is contained in:
parent
bb450e3a80
commit
2dfb12f23d
@ -30,9 +30,17 @@ public function handle(): void
|
||||
{
|
||||
$maintenances = Maintenance::all();
|
||||
foreach ($maintenances as $maintenance) {
|
||||
$cron = new CronExpression($maintenance->schedule);
|
||||
dump($cron->getNextRunDate(null, 2)->format('Y-m-d H:i:s'));
|
||||
$valid = CronExpression::isValidExpression($maintenance->schedule);
|
||||
if (!$valid) {
|
||||
dd($maintenance->schedule);
|
||||
return;
|
||||
}
|
||||
|
||||
$cron = new CronExpression($maintenance->schedule);
|
||||
if (!$cron->isDue('now')) {
|
||||
dd($cron->getNextRunDate());
|
||||
return;
|
||||
}
|
||||
|
||||
$maintenance->history()->create([
|
||||
'start_at' => $cron->getNextRunDate(null, 2)
|
||||
|
Loading…
Reference in New Issue
Block a user