| Conditions | 5 |
| Paths | 4 |
| Total Lines | 21 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 30 |
| Changes | 0 | ||
| 1 | <?php |
||
| 38 | public static function run() |
||
| 39 | { |
||
| 40 | $queue = Craft::$app->getQueue(); |
||
| 41 | // Make sure the queue uses the Craft web interface |
||
| 42 | if (!$queue instanceof QueueInterface) { |
||
| 43 | return; |
||
| 44 | } |
||
| 45 | |||
| 46 | // Make sure Craft is configured to run queues over the web |
||
| 47 | if (!Craft::$app->getConfig()->getGeneral()->runQueueAutomatically) { |
||
| 48 | return; |
||
| 49 | } |
||
| 50 | |||
| 51 | // Make sure the queue isn't already running, and there are waiting jobs |
||
| 52 | if ($queue->getHasReservedJobs() || !$queue->getHasWaitingJobs()) { |
||
| 53 | return; |
||
| 54 | } |
||
| 55 | |||
| 56 | // Run the queue |
||
| 57 | App::maxPowerCaptain(); |
||
| 58 | $queue->run(); |
||
| 59 | } |
||
| 79 |