Exemplo n.º 1
0
 private function doJob()
 {
     date_default_timezone_set('UTC');
     $info = new Information();
     // Save process to db
     $info->setProcessId(getmypid());
     $info->setHostname(gethostname());
     $info->setExtra(self::ID_TYPE);
     $info->setProcessMaxRetryTimeBeforeContinue($this->processMaxRetryTimeBeforeContinue);
     $request = new Request(['id' => $info->getProcessId(), 'server' => $info->getHostname(), 'extra' => $info->getExtra(), 'creatingDateTime' => date('Y-m-d H:i:s')]);
     $this->runUseCaseWithNoOfRetriesOnFail('process|create', $request, $this->processMaxRetryTimeBeforeContinue);
     $actTask = new ActTask($info, $this->callback, $this->externalTypeId);
     $actTask->execute();
     $this->runUseCaseWithNoOfRetriesOnFail('process|delete', $request, $this->processMaxRetryTimeBeforeContinue);
 }
Exemplo n.º 2
0
 public function testActTask()
 {
     //$this->cleanAndPopulateDatabase();
     $myObject = new ActCallback();
     $info = new Information();
     // Save process to db
     $info->setProcessId(1234);
     $info->setHostname('anim.stage.lsex.dev');
     $info->setExtra(1);
     $info->setProcessMaxRetryTimeBeforeContinue(3);
     $request = new Request(['id' => $info->getProcessId(), 'server' => $info->getHostname(), 'extra' => $info->getExtra(), 'creatingDateTime' => date('Y-m-d H:i:s')]);
     $this->runUseCaseWithNoOfRetriesOnFail('process|create', $request, 3);
     $actTask = new ActTask($info, $myObject, 2);
     $actTask->execute();
     $this->runUseCaseWithNoOfRetriesOnFail('process|delete', $request, 3);
 }