/** * Launch a job * TODO: refactor all this * * @param JobInstance $job */ protected function launchJob(JobInstance $job) { $app = new Application($this->container->get('kernel')); $cmd = new BatchCommand(); $cmd->setContainer($this->container); $cmd->setApplication($app); $cmd->run(new ArrayInput(['command' => 'akeneo:batch:job', 'code' => $job->getCode(), '--no-debug' => true, '--no-log' => true, '-v' => true]), new ConsoleOutput()); $execution = $this->getJobExecution($job); if (!$this->executionComplete($execution)) { throw new JobExecutionException($execution); } }
/** * Launch a job * TODO: refactor all this * * @param JobInstance $job */ protected function launchJob(JobInstance $job) { $app = new Application($this->container->get('kernel')); $cmd = new BatchCommand(); $cmd->setContainer($this->container); $cmd->setApplication($app); $cmd->run(new ArrayInput(['command' => 'akeneo:batch:job', 'code' => $job->getCode(), '--no-debug' => true]), new ConsoleOutput()); $execution = $this->getJobExecution($job); if (ExitStatus::COMPLETED !== $execution->getExitStatus()->getExitCode()) { throw new \Exception(sprintf('An error occured during execution of the job "%s", detailled trace can be found in %s', $job->getCode(), $execution->getLogFile())); } }