| Conditions | 2 |
| Paths | 2 |
| Total Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 33 | 2 | public function handle() : void |
|
| 34 | { |
||
| 35 | 2 | $reportInProcess = Report::where('status', Report::STATUS_PROCESS)->get(); |
|
| 36 | |||
| 37 | 2 | if ($reportInProcess->count() > 0) { |
|
| 38 | 1 | $reportInProcess = $reportInProcess->random(); |
|
| 39 | 1 | $reportInProcess->update([ |
|
| 40 | 1 | 'pid' => getmypid(), |
|
| 41 | 1 | 'status' => Report::STATUS_WORKER |
|
| 42 | ]); |
||
| 43 | 1 | $this->call('reports:handle', ['classReport' => $reportInProcess->class_name]); |
|
| 44 | } else { |
||
| 45 | 1 | $this->warn('Reports in the status "in process" is missing'); |
|
| 46 | } |
||
| 47 | } |
||
| 48 | } |