コード例 #1
0
ファイル: TaskList.php プロジェクト: luisbrito/Phraseanet
 public function entityToTask(TaskEntity $task)
 {
     $name = $task->getId();
     $arguments = ['exec', $this->phpExec];
     if ($this->phpConf) {
         $arguments[] = '-c';
         $arguments[] = $this->phpConf;
     }
     $arguments[] = '-f';
     $arguments[] = $this->root . '/bin/console';
     $arguments[] = '--';
     $arguments[] = '-q';
     $arguments[] = 'task-manager:task:run';
     $arguments[] = $task->getId();
     $arguments[] = '--listen-signal';
     $arguments[] = '--max-duration';
     $arguments[] = '1800';
     $arguments[] = '--max-memory';
     $arguments[] = 128 << 20;
     $builder = ProcessBuilder::create($arguments);
     $builder->setTimeout(0);
     return new Task($task, $name, $task->isSingleRun() ? 1 : INF, $builder->getProcess());
 }
 /**
  * {@inheritDoc}
  */
 public function isSingleRun()
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'isSingleRun', array());
     return parent::isSingleRun();
 }