本文整理汇总了PHP中kFileSyncUtils::deleteSyncFileForKey方法的典型用法代码示例。如果您正苦于以下问题:PHP kFileSyncUtils::deleteSyncFileForKey方法的具体用法?PHP kFileSyncUtils::deleteSyncFileForKey怎么用?PHP kFileSyncUtils::deleteSyncFileForKey使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kFileSyncUtils
的用法示例。
在下文中一共展示了kFileSyncUtils::deleteSyncFileForKey方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: syncableDeleted
/**
* @param string $id
* @param int $type
*/
protected function syncableDeleted($id, $type)
{
$c = new Criteria();
$c->add(FileSyncPeer::OBJECT_ID, $id);
$c->add(FileSyncPeer::OBJECT_TYPE, $type);
$c->add(FileSyncPeer::STATUS, array(FileSync::FILE_SYNC_STATUS_PURGED, FileSync::FILE_SYNC_STATUS_DELETED), Criteria::NOT_IN);
$fileSyncs = FileSyncPeer::doSelect($c);
foreach ($fileSyncs as $fileSync) {
$key = kFileSyncUtils::getKeyForFileSync($fileSync);
kFileSyncUtils::deleteSyncFileForKey($key);
}
}
示例2: handleStorageExportFinished
/**
* @param BatchJob $dbBatchJob
* @param kStorageExportJobData $data
* @return BatchJob
*/
public static function handleStorageExportFinished(BatchJob $dbBatchJob, kStorageExportJobData $data)
{
KalturaLog::debug("Export to storage finished for sync file[" . $data->getSrcFileSyncId() . "]");
$fileSync = FileSyncPeer::retrieveByPK($data->getSrcFileSyncId());
$fileSync->setStatus(FileSync::FILE_SYNC_STATUS_READY);
$fileSync->save();
if ($dbBatchJob->getJobSubType() != StorageProfile::STORAGE_KALTURA_DC) {
$partner = $dbBatchJob->getPartner();
if ($partner && $partner->getStorageDeleteFromKaltura()) {
$syncKey = kFileSyncUtils::getKeyForFileSync($fileSync);
kFileSyncUtils::deleteSyncFileForKey($syncKey, false, true);
}
}
return $dbBatchJob;
}
示例3: handleConvertFailed
public static function handleConvertFailed(BatchJob $dbBatchJob, $engineType, $flavorAssetId, $flavorParamsOutputId, $mediaInfoId)
{
$flavorAsset = assetPeer::retrieveById($flavorAssetId);
// verifies that flavor asset exists
if (!$flavorAsset) {
throw new APIException(APIErrors::INVALID_FLAVOR_ASSET_ID, $flavorAssetId);
}
/*
* On Webex error, roll back the inter-src asset version in order to allow the retry to get ARF as a source,
* rather than the invlaid WMV file (product of bad nbrplayer session)
*/
if ($dbBatchJob->getErrNumber() == BatchJobAppErrors::BLACK_OR_SILENT_CONTENT) {
$prevVer = $flavorAsset->getPreviousVersion();
$currVer = $flavorAsset->getVersion();
KalturaLog::log("Webex conversion - Garbled Audio or Black frame or Silence. Rolling back asset/file-sync version - curr({$currVer}), prev({$prevVer})");
if (isset($prevVer)) {
$syncKey = $flavorAsset->getSyncKey(asset::FILE_SYNC_ASSET_SUB_TYPE_ASSET, $currVer);
if (isset($syncKey)) {
kFileSyncUtils::deleteSyncFileForKey($syncKey, false, true);
$flavorAsset->setVersion($prevVer);
$flavorAsset->setPreviousVersion(null);
KalturaLog::log("Webex conversion - Rolled back");
}
}
}
$flavorAsset->setStatus(flavorAsset::FLAVOR_ASSET_STATUS_ERROR);
$flavorAsset->save();
// try to create a convert job with the next engine
if (!is_null($engineType)) {
$data = $dbBatchJob->getData();
if ($data instanceof kConvartableJobData) {
$data->incrementOperationSet();
$dbBatchJob->setData($data);
$dbBatchJob->save();
}
$newDbBatchJob = kBusinessPreConvertDL::redecideFlavorConvert($flavorAssetId, $flavorParamsOutputId, $mediaInfoId, $dbBatchJob, $engineType);
if ($newDbBatchJob) {
return true;
}
}
// find the root job
$rootBatchJob = $dbBatchJob->getRootJob();
if (!$rootBatchJob) {
return false;
}
// the root is already failed
if ($rootBatchJob->getStatus() == BatchJob::BATCHJOB_STATUS_FAILED || $rootBatchJob->getStatus() == BatchJob::BATCHJOB_STATUS_FATAL) {
return false;
}
// bulk download root job no need to handle
if ($rootBatchJob->getJobType() == BatchJobType::BULKDOWNLOAD) {
kJobsManager::failBatchJob($rootBatchJob, "Convert job " . $dbBatchJob->getId() . " failed");
return false;
}
if (is_null($flavorParamsOutputId)) {
kJobsManager::failBatchJob($rootBatchJob, "Job " . $dbBatchJob->getId() . " failed");
kBatchManager::updateEntry($dbBatchJob->getEntryId(), entryStatus::ERROR_CONVERTING);
return false;
}
$readyBehavior = $dbBatchJob->getData()->getReadyBehavior();
if ($readyBehavior == flavorParamsConversionProfile::READY_BEHAVIOR_REQUIRED) {
kJobsManager::failBatchJob($rootBatchJob, "Job " . $dbBatchJob->getId() . " failed");
kBatchManager::updateEntry($dbBatchJob->getEntryId(), entryStatus::ERROR_CONVERTING);
return false;
}
// failing the root profile job if all child jobs failed
if ($rootBatchJob->getJobType() != BatchJobType::CONVERT_PROFILE) {
return false;
}
$siblingJobs = $rootBatchJob->getChildJobs();
foreach ($siblingJobs as $siblingJob) {
/* @var $siblingJob BatchJob */
// not conversion job and should be ignored
if ($siblingJob->getJobType() != BatchJobType::CONVERT && $siblingJob->getJobType() != BatchJobType::POSTCONVERT) {
continue;
}
$jobData = $siblingJob->getData();
if (!$jobData || !$jobData instanceof kConvertJobData && !$jobData instanceof kPostConvertJobData) {
KalturaLog::err("Job id [" . $siblingJob->getId() . "] has no valid job data");
continue;
}
// found child flavor asset that hasn't failed, no need to fail the root job
$siblingFlavorAssetId = $jobData->getFlavorAssetId();
$siblingFlavorAsset = assetPeer::retrieveById($siblingFlavorAssetId);
if ($siblingFlavorAsset && $siblingFlavorAsset->getStatus() != flavorAsset::FLAVOR_ASSET_STATUS_ERROR && $siblingFlavorAsset->getStatus() != flavorAsset::FLAVOR_ASSET_STATUS_NOT_APPLICABLE && $siblingFlavorAsset->getStatus() != flavorAsset::FLAVOR_ASSET_STATUS_DELETED) {
return false;
}
}
// all conversions failed, should fail the root job
kJobsManager::failBatchJob($rootBatchJob, "All conversions failed");
kBatchManager::updateEntry($dbBatchJob->getEntryId(), entryStatus::ERROR_CONVERTING);
return false;
}
示例4: deleteFileSync
/**
* @param FileSync $fileSync
*/
protected static function deleteFileSync(FileSync $fileSync)
{
KalturaLog::info("Deleting file sync [" . $fileSync->getId() . "]");
$key = kFileSyncUtils::getKeyForFileSync($fileSync);
try {
kFileSyncUtils::deleteSyncFileForKey($key);
} catch (Exception $e) {
KalturaLog::err($e);
}
self::incrementSummary('FileSync');
}
示例5: deleteAssetLocalFileSyncs
private static function deleteAssetLocalFileSyncs($fileSyncVersion, asset $asset)
{
$syncKey = $asset->getSyncKey(asset::FILE_SYNC_ASSET_SUB_TYPE_ASSET, $fileSyncVersion);
kFileSyncUtils::deleteSyncFileForKey($syncKey, false, true);
$syncKey = $asset->getSyncKey(asset::FILE_SYNC_ASSET_SUB_TYPE_ISM, $fileSyncVersion);
kFileSyncUtils::deleteSyncFileForKey($syncKey, false, true);
$syncKey = $asset->getSyncKey(asset::FILE_SYNC_ASSET_SUB_TYPE_ISMC, $fileSyncVersion);
kFileSyncUtils::deleteSyncFileForKey($syncKey, false, true);
}
示例6: Criteria
// ----------------------------
$exportedFileSyncsCriteria = new Criteria();
$exportedFileSyncsCriteria->setLimit($loopLimit);
$exportedFileSyncsCriteria->addAscendingOrderByColumn(FileSyncPeer::ID);
$exportedFileSyncsCriteria->addAnd(FileSyncPeer::DC, $storageProfileId, Criteria::EQUAL);
$exportedFileSyncsCriteria->addAnd(FileSyncPeer::STATUS, FileSync::FILE_SYNC_STATUS_READY, Criteria::EQUAL);
$exportedFileSyncsCriteria->addAnd(FileSyncPeer::PARTNER_ID, $partnerId, Criteria::EQUAL);
if ($lastFileSyncId) {
$exportedFileSyncsCriteria->addAnd(FileSyncPeer::ID, $lastFileSyncId, Criteria::GREATER_THAN);
}
$exportedFileSyncs = FileSyncPeer::doSelect($exportedFileSyncsCriteria, myDbHelper::getConnection(myDbHelper::DB_HELPER_CONN_PROPEL3));
// -----------------------------------------------
// delete the local dcs copies of each file sync
// -----------------------------------------------
foreach ($exportedFileSyncs as $exportedFileSync) {
$lastFileSyncId = $exportedFileSync->getId();
$syncKey = kFileSyncUtils::getKeyForFileSync($exportedFileSync);
echo 'Deleting file sync key - ' . serialize($syncKey) . PHP_EOL;
kFileSyncUtils::deleteSyncFileForKey($syncKey, false, true);
// 3rd param = true -> only delete from local dcs
}
// --------------------------
// check if loop should end
// --------------------------
if (count($exportedFileSyncs) < $loopLimit) {
$moreFileSyncs = false;
}
$exportedFileSyncs = null;
kMemoryManager::clearMemory();
}
echo '-- Done --' . PHP_EOL;
示例7: handleStorageExportFinished
/**
* @param BatchJob $dbBatchJob
* @param kStorageExportJobData $data
* @return BatchJob
*/
public static function handleStorageExportFinished(BatchJob $dbBatchJob, kStorageExportJobData $data)
{
KalturaLog::debug("Export to storage finished for sync file[" . $data->getSrcFileSyncId() . "]");
$fileSync = FileSyncPeer::retrieveByPK($data->getSrcFileSyncId());
$fileSync->setStatus(FileSync::FILE_SYNC_STATUS_READY);
$fileSync->save();
// if an asset was exported - check if should set its status to READY
$asset = assetPeer::retrieveByFileSync($fileSync);
if ($asset && in_array($asset->getStatus(), array(asset::ASSET_STATUS_EXPORTING, asset::ASSET_STATUS_ERROR))) {
$asset->setStatusLocalReady();
$asset->save();
if ($asset instanceof flavorAsset && $asset->getStatus() == asset::ASSET_STATUS_READY) {
kBusinessPostConvertDL::handleConvertFinished($dbBatchJob, $asset);
}
}
// check if all exports finished and delete local file sync according to configuration
if ($asset && $asset->getStatus() == asset::ASSET_STATUS_READY && $dbBatchJob->getJobSubType() != StorageProfile::STORAGE_KALTURA_DC) {
$partner = $dbBatchJob->getPartner();
if ($partner && $partner->getStorageDeleteFromKaltura()) {
$syncKey = kFileSyncUtils::getKeyForFileSync($fileSync);
kFileSyncUtils::deleteSyncFileForKey($syncKey, false, true);
}
}
return $dbBatchJob;
}