| 1 | <?php |
||
| 9 | class ProcessJobQueueChildTask extends BuildTask |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * {@inheritDoc} |
||
| 13 | * @var string |
||
| 14 | */ |
||
| 15 | private static $segment = 'ProcessJobQueueChildTask'; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @param HTTPRequest $request |
||
| 19 | */ |
||
| 20 | public function run($request) |
||
| 21 | { |
||
| 22 | if (!isset($_SERVER['argv'][2])) { |
||
| 23 | print "No task data provided.\n"; |
||
| 24 | return; |
||
| 25 | } |
||
| 26 | |||
| 27 | $task = @unserialize(@base64_decode($_SERVER['argv'][2])); |
||
| 28 | |||
| 29 | if ($task) { |
||
| 30 | $this->getService()->runJob($task->getDescriptor()->ID); |
||
| 31 | } |
||
| 32 | } |
||
| 33 | |||
| 34 | /** |
||
| 35 | * Returns an instance of the QueuedJobService. |
||
| 36 | * |
||
| 37 | * @return QueuedJobService |
||
| 38 | */ |
||
| 39 | protected function getService() |
||
| 40 | { |
||
| 41 | return QueuedJobService::class::singleton(); |
||
|
|
|||
| 42 | } |
||
| 43 | } |
||
| 44 |