Example #1
0
 protected function splitTask(Gpf_Db_Task $task)
 {
     $workingAreaTo = $task->getWorkingAreaTo();
     $splitNumber = intval(($task->getWorkingAreaTo() - $task->getWorkingAreaFrom()) / 2);
     $task->setWorkingAreaTo($task->getWorkingAreaFrom() + $splitNumber);
     $task->update();
     if ($task->get(Gpf_Db_Table_Tasks::ID) == $this->task->get(Gpf_Db_Table_Tasks::ID)) {
         $this->task = $task;
     }
     $this->createWorker($task->getWorkingAreaFrom() + $splitNumber + 1, $workingAreaTo);
 }