示例#1
0
 private static function commonLockObjectUpdate(BatchJob $batchJob, BatchJobLock $batchJobLock)
 {
     $jobType = $batchJob->getJobType();
     $batchJobLock->setStatus($batchJob->getStatus());
     $batchJobLock->setObjectId($batchJob->getObjectId());
     $batchJobLock->setObjectType($batchJob->getObjectType());
     if ($batchJob->getStatus() == BatchJob::BATCHJOB_STATUS_RETRY || $batchJob->getStatus() == BatchJob::BATCHJOB_STATUS_ALMOST_DONE) {
         $batchJobLock->setStartAt(time() + BatchJobLockPeer::getRetryInterval($jobType));
     }
     if ($batchJob->getLockInfo() != null) {
         $batchJobLock->setPriority($batchJob->getLockInfo()->getPriority());
         $batchJobLock->setUrgency($batchJob->getLockInfo()->getUrgency());
         $batchJobLock->setEstimatedEffort($batchJob->getLockInfo()->getEstimatedEffort());
         $batchJobLock->setVersion($batchJob->getLockInfo()->getLockVersion());
     }
 }