public static function addDeleteFileJob(BatchJob $parentJob = null, $entryId = null, $partnerId, $syncKey, $localFileSyncPath, $dc) { $deleteFileData = new kDeleteFileJobData(); $deleteFileData->setLocalFileSyncPath($localFileSyncPath); $deleteFileData->setSyncKey($syncKey); if ($parentJob) { $batchJob = $parentJob->createChild(BatchJobType::DELETE_FILE, null, false); } else { $batchJob = new BatchJob(); $batchJob->setEntryId($entryId); $batchJob->setPartnerId($partnerId); } $batchJob->setDc($dc); KalturaLog::log("Creating File Delete job, from data center id: " . $dc . " with source file: " . $deleteFileData->getLocalFileSyncPath()); return self::addJob($batchJob, $deleteFileData, BatchJobType::DELETE_FILE); }
public static function addFutureDeletionJob(BatchJob $parentJob = null, $entryId = null, Partner $partner, $syncKey, $localFileSyncPath, $dc) { $deleteFileData = new kDeleteFileJobData(); $deleteFileData->setLocalFileSyncPath($localFileSyncPath); $deleteFileData->setSyncKey($syncKey); if ($parentJob) { $batchJob = $parentJob->createChild(false); } else { $batchJob = new BatchJob(); $batchJob->setEntryId($entryId); $batchJob->setPartnerId($partner->getId()); } $batchJob->setStatus(BatchJob::BATCHJOB_STATUS_RETRY); $batchJob->setCheckAgainTimeout(12 * 60 * 60); $batchJob->setDc($dc); KalturaLog::log("Creating File Delete job, from data center id: " . $deleteFileData->getDC() . " with source file: " . $deleteFileData->getLocalFileSyncPath()); return self::addJob($batchJob, $deleteFileData, BatchJobType::DELETE_FILE); }