本文整理汇总了PHP中kJobsManager::retryJob方法的典型用法代码示例。如果您正苦于以下问题:PHP kJobsManager::retryJob方法的具体用法?PHP kJobsManager::retryJob怎么用?PHP kJobsManager::retryJob使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kJobsManager
的用法示例。
在下文中一共展示了kJobsManager::retryJob方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: handlePostConvertFinished
/**
* @param BatchJob $dbBatchJob
* @param kPostConvertJobData $data
* @param BatchJob $twinJob
* @return BatchJob|BatchJob
*/
public static function handlePostConvertFinished(BatchJob $dbBatchJob, kPostConvertJobData $data, BatchJob $twinJob = null)
{
if ($dbBatchJob->getAbort()) {
return $dbBatchJob;
}
if ($data->getCreateThumb()) {
try {
self::createThumbnail($dbBatchJob, $data);
} catch (Exception $e) {
KalturaLog::err($e->getMessage());
// sometimes, because of disc IO load, it takes long time for the thumb to be moved.
// in such cases, the entry thumb version may be increased by other process.
// retry the job, it solves the issue.
kJobsManager::retryJob($dbBatchJob->getId(), $dbBatchJob->getJobType(), true);
$dbBatchJob->reload();
return $dbBatchJob;
}
}
$currentFlavorAsset = kBusinessPostConvertDL::handleFlavorReady($dbBatchJob, $data->getFlavorAssetId());
if ($dbBatchJob->getJobSubType() == BatchJob::BATCHJOB_SUB_TYPE_POSTCONVERT_SOURCE) {
try {
kBusinessPreConvertDL::continueProfileConvert($dbBatchJob);
} catch (Exception $e) {
KalturaLog::err($e->getMessage());
kBatchManager::updateEntry($dbBatchJob, entryStatus::ERROR_CONVERTING);
return $dbBatchJob;
}
}
if ($currentFlavorAsset) {
kBusinessPostConvertDL::handleConvertFinished($dbBatchJob, $currentFlavorAsset);
}
return $dbBatchJob;
}
示例2: handlePostConvertFinished
/**
* @param BatchJob $dbBatchJob
* @param kPostConvertJobData $data
* @return BatchJob|BatchJob
*/
public static function handlePostConvertFinished(BatchJob $dbBatchJob, kPostConvertJobData $data)
{
if ($dbBatchJob->getExecutionStatus() == BatchJobExecutionStatus::ABORTED) {
return $dbBatchJob;
}
if ($data->getCreateThumb()) {
try {
self::createThumbnail($dbBatchJob, $data);
} catch (Exception $e) {
KalturaLog::err($e->getMessage());
// sometimes, because of disc IO load, it takes long time for the thumb to be moved.
// in such cases, the entry thumb version may be increased by other process.
// retry the job, it solves the issue.
kJobsManager::retryJob($dbBatchJob->getId(), $dbBatchJob->getJobType(), true);
$dbBatchJob->reload();
return $dbBatchJob;
}
}
$currentFlavorAsset = kBusinessPostConvertDL::handleFlavorReady($dbBatchJob, $data->getFlavorAssetId());
if ($data->getPostConvertAssetType() == BatchJob::POSTCONVERT_ASSET_TYPE_SOURCE) {
$convertProfileJob = $dbBatchJob->getRootJob();
if ($convertProfileJob->getJobType() == BatchJobType::CONVERT_PROFILE) {
try {
$currFlavorAsset = assetPeer::retrieveById($data->getFlavorAssetId());
//In cases we are returning from intermediate flow need to check maybe if another round is needed
//This comes to support the creation of silent audio tracks on source assets such as .arf that require initial inter flow for the source and only than the addition
//of the silent audio track
if ($currFlavorAsset instanceof flavorAsset && $currFlavorAsset->getIsOriginal() && $currFlavorAsset->getInterFlowCount() != null) {
//check if the inter flow count is larger than 2.
//In this cases probably something went wrong so we will continue with the original flow and will not check if any additioanl inter flow nneds to be done.
if ($currentFlavorAsset && $currFlavorAsset->getInterFlowCount() < self::MAX_INTER_FLOW_ITERATIONS_ALLOWED_ON_SOURCE) {
$mediaInfo = mediaInfoPeer::retrieveByFlavorAssetId($currentFlavorAsset->getId());
kBusinessPreConvertDL::decideProfileConvert($dbBatchJob, $convertProfileJob, $mediaInfo->getId());
} else {
kBusinessPreConvertDL::continueProfileConvert($dbBatchJob);
}
} else {
kBusinessPreConvertDL::continueProfileConvert($dbBatchJob);
}
} catch (Exception $e) {
KalturaLog::err($e->getMessage());
kBatchManager::updateEntry($dbBatchJob->getEntryId(), entryStatus::ERROR_CONVERTING);
return $dbBatchJob;
}
} elseif ($currentFlavorAsset) {
KalturaLog::log("Root job [" . $convertProfileJob->getId() . "] is not profile conversion");
$syncKey = $currentFlavorAsset->getSyncKey(flavorAsset::FILE_SYNC_FLAVOR_ASSET_SUB_TYPE_ASSET);
if (kFileSyncUtils::fileSync_exists($syncKey)) {
$path = kFileSyncUtils::getLocalFilePathForKey($syncKey);
$entry = $dbBatchJob->getEntry();
if ($entry) {
kJobsManager::addConvertProfileJob(null, $entry, $currentFlavorAsset->getId(), $path);
}
}
$currentFlavorAsset = null;
}
}
if ($currentFlavorAsset) {
kBusinessPostConvertDL::handleConvertFinished($dbBatchJob, $currentFlavorAsset);
}
return $dbBatchJob;
}
示例3: retryJobAction
/**
* batch retryJobAction aborts and returns the status of task
*
* @action retryJob
* @param int $jobId the id of the job
* @param KalturaBatchJobType $jobType the type of the job
* @return KalturaBatchJobResponse
*/
function retryJobAction($jobId, $jobType)
{
$dbJobType = kPluginableEnumsManager::apiToCore('BatchJobType', $jobType);
kJobsManager::retryJob($jobId, $dbJobType);
return $this->getStatusAction($jobId, $jobType);
}
示例4: handlePostConvertFinished
/**
* @param BatchJob $dbBatchJob
* @param kPostConvertJobData $data
* @param BatchJob $twinJob
* @return BatchJob|BatchJob
*/
public static function handlePostConvertFinished(BatchJob $dbBatchJob, kPostConvertJobData $data, BatchJob $twinJob = null)
{
if ($dbBatchJob->getAbort()) {
return $dbBatchJob;
}
if ($data->getCreateThumb()) {
try {
self::createThumbnail($dbBatchJob, $data);
} catch (Exception $e) {
KalturaLog::err($e->getMessage());
// sometimes, because of disc IO load, it takes long time for the thumb to be moved.
// in such cases, the entry thumb version may be increased by other process.
// retry the job, it solves the issue.
kJobsManager::retryJob($dbBatchJob->getId(), $dbBatchJob->getJobType(), true);
$dbBatchJob->reload();
return $dbBatchJob;
}
}
$currentFlavorAsset = kBusinessPostConvertDL::handleFlavorReady($dbBatchJob, $data->getFlavorAssetId());
if ($data->getPostConvertAssetType() == BatchJob::POSTCONVERT_ASSET_TYPE_SOURCE) {
$convertProfileJob = $dbBatchJob->getRootJob();
if ($convertProfileJob->getJobType() == BatchJobType::CONVERT_PROFILE) {
try {
kBusinessPreConvertDL::continueProfileConvert($dbBatchJob);
} catch (Exception $e) {
KalturaLog::err($e->getMessage());
kBatchManager::updateEntry($dbBatchJob->getEntryId(), entryStatus::ERROR_CONVERTING);
return $dbBatchJob;
}
} elseif ($currentFlavorAsset) {
KalturaLog::log("Root job [" . $convertProfileJob->getId() . "] is not profile conversion");
$syncKey = $currentFlavorAsset->getSyncKey(flavorAsset::FILE_SYNC_FLAVOR_ASSET_SUB_TYPE_ASSET);
if (kFileSyncUtils::fileSync_exists($syncKey)) {
KalturaLog::debug("Start conversion");
$path = kFileSyncUtils::getLocalFilePathForKey($syncKey);
$wamsAssetId = kFileSyncUtils::getWamsAssetIdForKey($syncKey);
kJobsManager::addConvertProfileJob(null, $dbBatchJob->getEntry(), $currentFlavorAsset->getId(), $path, $wamsAssetId);
} else {
KalturaLog::debug("File sync not created yet");
}
$currentFlavorAsset = null;
}
}
if ($currentFlavorAsset) {
kBusinessPostConvertDL::handleConvertFinished($dbBatchJob, $currentFlavorAsset);
}
return $dbBatchJob;
}