lasthourcloud/app/Console/Kernel.php

32 lines
1017 B
PHP
Raw Normal View History

2023-03-17 14:33:48 +00:00
<?php
namespace App\Console;
2023-05-25 12:23:49 +00:00
use App\Jobs\InstanceAutoUpdateJob;
2023-05-24 12:26:50 +00:00
use App\Jobs\InstanceProxyCheckJob;
2023-05-25 12:23:49 +00:00
use App\Jobs\InstanceDockerCleanupJob;
2023-03-17 14:33:48 +00:00
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel
{
protected function schedule(Schedule $schedule): void
{
2023-06-06 06:43:01 +00:00
if (config('app.env') === 'local') {
$schedule->command('horizon:snapshot')->everyMinute();
$schedule->job(new InstanceDockerCleanupJob)->everyMinute();
$schedule->job(new InstanceAutoUpdateJob(true))->everyMinute();
} else {
$schedule->command('horizon:snapshot')->everyFiveMinutes();
$schedule->job(new InstanceDockerCleanupJob)->everyFiveMinutes();
$schedule->job(new InstanceAutoUpdateJob)->everyFifteenMinutes();
}
2023-03-17 14:33:48 +00:00
}
protected function commands(): void
{
2023-04-28 07:00:47 +00:00
$this->load(__DIR__ . '/Commands');
2023-03-17 14:33:48 +00:00
require base_path('routes/console.php');
}
}