| Total Complexity | 5 |
| Total Lines | 66 |
| Duplicated Lines | 0 % |
| Coverage | 88.24% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 8 | class Kernel extends ConsoleKernel |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * The Artisan commands provided by your application. |
||
| 12 | * |
||
| 13 | * @var array |
||
|
|
|||
| 14 | */ |
||
| 15 | protected $commands = [ |
||
| 16 | // |
||
| 17 | ]; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * Define the application's command schedule. |
||
| 21 | * |
||
| 22 | * @param \Illuminate\Console\Scheduling\Schedule $schedule |
||
|
1 ignored issue
–
show
|
|||
| 23 | * @return void |
||
| 24 | */ |
||
| 25 | 97 | protected function schedule(Schedule $schedule): void |
|
| 26 | { |
||
| 27 | // $schedule->command('inspire') |
||
| 28 | // ->hourly(); |
||
| 29 | |||
| 30 | // start the queue daemon, if its not running |
||
|
1 ignored issue
–
show
|
|||
| 31 | 97 | if (!$this->osProcessIsRunning('queue:work')) { |
|
| 32 | 97 | $schedule->command('queue:work')->everyMinute(); |
|
| 33 | } |
||
| 34 | 97 | } |
|
| 35 | |||
| 36 | /** |
||
| 37 | * Register the commands for the application. |
||
| 38 | * |
||
| 39 | * @return void |
||
| 40 | */ |
||
| 41 | 97 | protected function commands(): void |
|
| 46 | 97 | } |
|
| 47 | |||
| 48 | /** |
||
| 49 | * checks, if a process with $needle in the name is running |
||
| 50 | * |
||
| 51 | * @param string $needle |
||
|
1 ignored issue
–
show
|
|||
| 52 | * @return boolean |
||
| 53 | */ |
||
| 54 | 97 | protected function osProcessIsRunning(string $needle): bool |
|
| 76 |