/** * @param BatchJob $dbBatchJob * @param kDistributionDeleteJobData $data * @param BatchJob $twinJob * @return BatchJob */ public static function onDistributionDeleteJobFailed(BatchJob $dbBatchJob, kDistributionDeleteJobData $data, BatchJob $twinJob = null) { $entryDistribution = EntryDistributionPeer::retrieveByPK($data->getEntryDistributionId()); if (!$entryDistribution) { KalturaLog::err("Entry distribution [" . $data->getEntryDistributionId() . "] not found"); return $dbBatchJob; } $entryDistribution->setErrorType($dbBatchJob->getErrType()); $entryDistribution->setErrorNumber($dbBatchJob->getErrNumber()); $entryDistribution->setErrorDescription($dbBatchJob->getMessage()); $entryDistribution->setStatus(EntryDistributionStatus::ERROR_DELETING); $entryDistribution->setDirtyStatus(null); $entryDistribution->save(); return $dbBatchJob; }
public static function preBatchJobUpdate(BatchJob $batchJob) { if ($batchJob->isColumnModified(BatchJobPeer::ERR_NUMBER) || $batchJob->isColumnModified(BatchJobPeer::ERR_TYPE) || $batchJob->isColumnModified(BatchJobPeer::MESSAGE)) { $historyRecord = new kBatchHistoryData(); $historyRecord->setErrNumber($batchJob->getErrNumber()); $historyRecord->setErrType($batchJob->getErrType()); $historyRecord->setMessage($batchJob->getMessage()); $batchJob->addHistoryRecord($historyRecord); } }
public static function handleLiveReportExportFailed(BatchJob $dbBatchJob, kLiveReportExportJobData $data) { $time = date("m-d-y H:i", $data->timeReference + $data->timeZoneOffset); $email_id = MailType::MAIL_TYPE_LIVE_REPORT_EXPORT_FAILURE; $params = array($dbBatchJob->getPartner()->getName(), $time, $dbBatchJob->getId(), $dbBatchJob->getErrType(), $dbBatchJob->getErrNumber()); $titleParams = array($time); kJobsManager::addMailJob(null, 0, $dbBatchJob->getPartnerId(), $email_id, kMailJobData::MAIL_PRIORITY_NORMAL, kConf::get("live_report_sender_email"), kConf::get("live_report_sender_name"), $data->recipientEmail, $params, $titleParams); return $dbBatchJob; }
/** * @param BatchJob $dbBatchJob * @param kStorageExportJobData $data * @return BatchJob */ public static function handleStorageExportFailed(BatchJob $dbBatchJob, kStorageExportJobData $data) { KalturaLog::debug("Export to storage failed for sync file[" . $data->getSrcFileSyncId() . "]"); if ($dbBatchJob->getErrType() == BatchJobErrorTypes::APP && $dbBatchJob->getErrNumber() == BatchJobAppErrors::FILE_ALREADY_EXISTS) { KalturaLog::notice("remote file already exists"); return $dbBatchJob; } $fileSync = FileSyncPeer::retrieveByPK($data->getSrcFileSyncId()); $fileSync->setStatus(FileSync::FILE_SYNC_STATUS_ERROR); $fileSync->save(); // if an asset was exported - check if should set its status to ERROR $asset = assetPeer::retrieveByFileSync($fileSync); if ($asset && $asset->getStatus() == asset::ASSET_STATUS_EXPORTING) { $asset->setStatus(asset::ASSET_STATUS_ERROR); $asset->save(); if ($asset instanceof flavorAsset) { $flavorParamsOutput = $asset->getFlavorParamsOutput(); $flavorParamsOutputId = $flavorParamsOutput ? $flavorParamsOutput->getId() : null; $mediaInfo = mediaInfoPeer::retrieveByFlavorAssetId($asset->getId()); $mediaInfoId = $mediaInfo ? $mediaInfo->getId() : null; kBusinessPostConvertDL::handleConvertFailed($dbBatchJob, null, $asset->getId(), $flavorParamsOutputId, $mediaInfoId); } } return $dbBatchJob; }