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); }
public static function handleDeleteFileProcessing(kDeleteFileJobData $data) { KalturaLog::info("Delete started for file path " . $data->getLocalFileSyncPath()); }
/** * @param BatchJob $dbBatchJob * @param kConvertCollectionJobData $data * @return BatchJob */ public static function handleDeleteFileFinished(BatchJob $dbBatchJob, kDeleteFileJobData $data) { KalturaLog::debug("File delete finished for file path: " . $data->getLocalFileSyncPath() . ", data center: " . $dbBatchJob->getDc()); //Change status of the filesync to "purged" $fileSyncFroDeletedFile = kFileSyncUtils::retrieveObjectForSyncKey($data->getSyncKey()); $fileSyncFroDeletedFile->setStatus(FileSync::FILE_SYNC_STATUS_PURGED); $fileSyncFroDeletedFile->save(); return $dbBatchJob; }