| Total Complexity | 6 |
| Total Lines | 40 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | class Kernel extends ConsoleKernel |
||
| 10 | { |
||
| 11 | protected $commands = []; |
||
| 12 | |||
| 13 | private Schedule $schedule; |
||
| 14 | |||
| 15 | protected function schedule(Schedule $schedule) |
||
| 16 | { |
||
| 17 | if (App::runningUnitTests()) { |
||
| 18 | return; |
||
| 19 | } |
||
| 20 | |||
| 21 | $this->schedule = $schedule; |
||
| 22 | |||
| 23 | $this->pruneFailedJobs() |
||
| 24 | ->horizonSnapshot(); |
||
| 25 | |||
| 26 | if (App::isProduction()) { |
||
| 27 | } |
||
| 28 | } |
||
| 29 | |||
| 30 | protected function commands() |
||
| 35 | } |
||
| 36 | |||
| 37 | private function pruneFailedJobs(): self |
||
| 38 | { |
||
| 39 | $this->schedule->command('queue:prune-failed', ['--hours' => 7 * 24]) |
||
| 40 | ->weekly(); |
||
| 41 | |||
| 42 | return $this; |
||
| 43 | } |
||
| 44 | |||
| 45 | private function horizonSnapshot(): void |
||
| 49 | } |
||
| 50 | } |
||
| 51 |