I have a Kernel.php class
<?php
namespace App\Console;
use App\Console\Commands\Tasks\Api\AnalyzerCallsCommand;
use App\Console\Commands\Tasks\Api\ModemCallsCommand;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel
{
protected function schedule(Schedule $schedule): void
{
$params = ['--api=v1', '--all'];
if (config('sitelight.api.debug')) {
$params[] = '--debug';
}
if (config('sitelight.commands.modems')) {
$schedule
->command(ModemCallsCommand::class, $params)
//->everyFourHours()
->cron(config('sitelight.cron.modems'));
}
if (config('sitelight.commands.analyzers')) {
$schedule
->command(AnalyzerCallsCommand::class, $params)
//->everyFifteenMinutes()
->cron(config('sitelight.cron.analyzers'));
}
if (config('sitelight.commands.converter')) {
$schedule->command('elk:analyzer')->everyFifteenMinutes();
$schedule->command('elk:command')->everySixHours();
}
// Cron for check scheduled_tasks
if (config('sitelight.queues.scheduled.is_active')) {
$schedule->command('task:cron_scheduled')->everyMinute();
//$schedule->command('task:check_scheduled')->everyMinute();
}
// Cron for update sun events
$schedule->command('task:updateSunInfo')->cron('1 0,3 * * * ');
// Cron for prune jobs failed
// $schedule->command('queue:prune-failed', ['--hours=48'])->cron('12 2 * * *');
// // Prune expired tokens
//$schedule->command('sanctum:prune-expired --hours=24')->daily();
//
// // Prune Bouncer abilities
// $schedule->command('bouncer:clean')->weekly();
//
// // Update total-consumption
//$schedule->command('task:update-total-consumption-command')->cron('*/5 * * * *');
//$schedule->command('task:update-total-consumption-command')->cron('0,5,10,15,20,25,30,35,40,45,50,55 * * * *');
}
protected function commands(): void
{
$this->load(__DIR__.'/Commands');
require base_path('routes/console.php');
}
}
If uncomment any of last schduled on bottom, when run php artisan a schedule:list get error
a schedule:list
ErrorException
Undefined array key 5
at vendor/laravel/framework/src/Illuminate/Console/Scheduling/ScheduleListCommand.php:187
183▕ {
184▕ $expressions = preg_split("/\s+/", $expression);
185▕
186▕ return collect($spacing)
➜ 187▕ ->map(fn ($length, $index) => str_pad($expressions[$index], $length))
188▕ ->implode(' ');
189▕ }
190▕
191▕ /**
+2 vendor frames
3 [internal]:0
Illuminate\Console\Scheduling\ScheduleListCommand::Illuminate\Console\Scheduling\{closure}()
+15 vendor frames
19 artisan:35
Illuminate\Foundation\Console\Kernel::handle()
But if comment any of top commands, not fails
Foir example comment //$schedule->command('task:updateSunInfo')->cron('1 0,3 * * * '); and new run
a schedule:list
0,5,10,15,20,25,30,35,40,45,50,55 * * * * php artisan task:update-total-consumption-command ......................................................................... Next Due: en 4 minutos
```
I'm lost...
There are any limits of commands?
In-depth error log... very strange.
a schedule:list
Error
Class "Redis" not found
at vendor/laravel/framework/src/Illuminate/Redis/Connectors/PhpRedisConnector.php:81
77▕ * @throws \LogicException
78▕ */
79▕ protected function createClient(array $config)
80▕ {
➜ 81▕ return tap(new Redis, function ($client) use ($config) {
82▕ if ($client instanceof RedisFacade) {
83▕ throw new LogicException(
84▕ extension_loaded('redis')
85▕ ? 'Please remove or rename the Redis facade alias in your "app" configuration file in order to avoid collision with the PHP Redis extension.'