-
-
Notifications
You must be signed in to change notification settings - Fork 27
/
Kernel.php
58 lines (50 loc) · 2.34 KB
/
Kernel.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?php
namespace App\Console;
use App\Console\Commands\GithubOrganizationDetails;
use App\Console\Commands\GithubOrganizationRepositories;
use App\Console\Commands\GithubRepositoryContributors;
use App\Console\Commands\GithubRepositoryDetails;
use App\Console\Commands\GithubUserDetails;
use App\Console\Commands\GithubUserRepositories;
use App\Models\User;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
use Laravel\Horizon\Console\SnapshotCommand;
use Laravel\Scout\Console\FlushCommand;
use Laravel\Scout\Console\ImportCommand;
use Spatie\Backup\Commands\BackupCommand;
use Spatie\Backup\Commands\CleanupCommand;
use Spatie\Backup\Commands\MonitorCommand;
use Spatie\ScheduleMonitor\Commands\CleanLogCommand;
class Kernel extends ConsoleKernel
{
protected function schedule(Schedule $schedule): void
{
// github:*:repositories
$schedule->command(GithubOrganizationRepositories::class)->dailyAt('03:00')->onOneServer();
$schedule->command(GithubUserRepositories::class)->dailyAt('03:00')->onOneServer();
// github:*:details
$schedule->command(GithubUserDetails::class)->dailyAt('12:00')->onOneServer();
$schedule->command(GithubOrganizationDetails::class)->dailyAt('12:00')->onOneServer();
$schedule->command(GithubRepositoryDetails::class)->dailyAt('12:00')->onOneServer();
// github:repository:contributors
$schedule->command(GithubRepositoryContributors::class)->dailyAt('15:00')->onOneServer();
// laravel/horizon
$schedule->command(SnapshotCommand::class)->everyFiveMinutes()->onOneServer()->environments('gorgeous-moon');
// laravel/scout
$schedule->command(FlushCommand::class, [User::class])
->dailyAt('02:00')
->onOneServer()
->onSuccess(fn () => $this->call(ImportCommand::class, ['model' => User::class]));
// spatie/laravel-schedule-monitor
$schedule->command(CleanLogCommand::class)->dailyAt('01:00')->onOneServer();
// spatie/laravel-backup
$schedule->command(BackupCommand::class)->twiceDaily(1, 13);
$schedule->command(CleanupCommand::class)->dailyAt('09:00');
$schedule->command(MonitorCommand::class)->dailyAt('10:00');
}
protected function commands(): void
{
$this->load(__DIR__.'/Commands');
}
}