/** * Test if the process is still running * @param JobExecution $jobExecution * * @return bool */ protected function processIsRunning(JobExecution $jobExecution) { $pid = intval($jobExecution->getPid()); if ($pid <= 0) { throw new \InvalidArgumentException('The job execution PID is not valid'); } exec(sprintf('ps -p %s', $pid), $output, $returnCode); return 0 === $returnCode; }
/** * {@inheritDoc} */ public function getPid() { $this->__initializer__ && $this->__initializer__->__invoke($this, 'getPid', array()); return parent::getPid(); }