コード例 #1
0
 protected function updatedVirusScanFailed(BatchJob $dbBatchJob, kVirusScanJobData $data, BatchJob $twinJob = null)
 {
     $entry = entryPeer::retrieveByPK($dbBatchJob->getEntryId());
     if ($entry) {
         $entry->setStatus(VirusScanPlugin::getEntryStatusCoreValue(VirusScanEntryStatus::INFECTED));
         $entry->save();
     } else {
         KalturaLog::err('Entry not found with id [' . $dbBatchJob->getEntryId() . ']');
         throw new Exception('Entry not found with id [' . $dbBatchJob->getEntryId() . ']');
     }
     $flavorAsset = flavorAssetPeer::retrieveById($data->getFlavorAssetId());
     if ($flavorAsset) {
         $flavorAsset->setStatus(flavorAsset::FLAVOR_ASSET_STATUS_ERROR);
         $flavorAsset->save();
     } else {
         KalturaLog::err('Flavor asset not found with id [' . $data->getFlavorAssetId() . ']');
         throw new Exception('Flavor asset not found with id [' . $data->getFlavorAssetId() . ']');
     }
     // do not resume flavor asset added event consumption
     return $dbBatchJob;
 }
コード例 #2
0
 protected function updatedVirusScanFailed(BatchJob $dbBatchJob, kVirusScanJobData $data)
 {
     $entry = entryPeer::retrieveByPKNoFilter($dbBatchJob->getEntryId());
     if ($entry) {
         self::setEntryStatusBeforeScanFailure($entry, $entry->getStatus());
         $entry->setStatus(VirusScanPlugin::getEntryStatusCoreValue(VirusScanEntryStatus::SCAN_FAILURE));
         $entry->save();
         myNotificationMgr::createNotification(kNotificationJobData::NOTIFICATION_TYPE_ENTRY_UPDATE, $entry);
     } else {
         KalturaLog::err('Entry not found with id [' . $dbBatchJob->getEntryId() . ']');
         throw new Exception('Entry not found with id [' . $dbBatchJob->getEntryId() . ']');
     }
     $flavorAsset = assetPeer::retrieveById($data->getFlavorAssetId());
     if ($flavorAsset) {
         self::setFlavorAssetStatusBeforeScanFailure($flavorAsset, $flavorAsset->getStatus());
         $flavorAsset->setStatus(flavorAsset::FLAVOR_ASSET_STATUS_ERROR);
         $flavorAsset->save();
     } else {
         KalturaLog::err('Flavor asset not found with id [' . $data->getFlavorAssetId() . ']');
         throw new Exception('Flavor asset not found with id [' . $data->getFlavorAssetId() . ']');
     }
     // do not resume flavor asset added event consumption
     return $dbBatchJob;
 }