Example #1
0
 public function clearMemory()
 {
     accessControlPeer::clearInstancePool();
     BatchJobPeer::clearInstancePool();
     BulkUploadResultPeer::clearInstancePool();
     categoryPeer::clearInstancePool();
     EmailIngestionProfilePeer::clearInstancePool();
     entryPeer::clearInstancePool();
     FileSyncPeer::clearInstancePool();
     flavorAssetPeer::clearInstancePool();
     flavorParamsConversionProfilePeer::clearInstancePool();
     flavorParamsOutputPeer::clearInstancePool();
     flavorParamsPeer::clearInstancePool();
     kshowPeer::clearInstancePool();
     mediaInfoPeer::clearInstancePool();
     moderationFlagPeer::clearInstancePool();
     moderationPeer::clearInstancePool();
     notificationPeer::clearInstancePool();
     roughcutEntryPeer::clearInstancePool();
     SchedulerConfigPeer::clearInstancePool();
     SchedulerPeer::clearInstancePool();
     SchedulerStatusPeer::clearInstancePool();
     SchedulerWorkerPeer::clearInstancePool();
     StorageProfilePeer::clearInstancePool();
     syndicationFeedPeer::clearInstancePool();
     TrackEntryPeer::clearInstancePool();
     uiConfPeer::clearInstancePool();
     UploadTokenPeer::clearInstancePool();
     // TODO clear default filters
     // TODO call all memory cleaner plugins
     if (function_exists('gc_collect_cycles')) {
         // php 5.3 and above
         gc_collect_cycles();
     }
 }
 private function clearMemory()
 {
     entryPeer::clearInstancePool();
     flavorAssetPeer::clearInstancePool();
     FileSyncPeer::clearInstancePool();
     categoryPeer::clearInstancePool();
     if (class_exists('MetadataPeer')) {
         MetadataPeer::clearInstancePool();
         MetadataProfilePeer::clearInstancePool();
     }
 }
$entryCriteria->add(entryPeer::STATUS, entry::ENTRY_STATUS_READY);
$entryCriteria->add(entryPeer::MEDIA_TYPE, array(entry::ENTRY_MEDIA_TYPE_AUDIO, entry::ENTRY_MEDIA_TYPE_VIDEO), Criteria::IN);
$entryCriteria->add(entryPeer::LENGTH_IN_MSECS, array(0, null), Criteria::IN);
if (!is_null($partnerId)) {
    $entryCriteria->add(entryPeer::PARTNER_ID, $partnerId);
}
$entryCriteria->setLimit(8000);
$entryCriteria->clearSelectColumns();
$entryCriteria->addSelectColumn(entryPeer::ID);
$con = myDbHelper::getConnection(myDbHelper::DB_HELPER_CONN_PROPEL2);
$rs = entryPeer::doSelectStmt($entryCriteria, $con);
$entries = $rs->fetchAll(PDO::FETCH_COLUMN);
$saved = 0;
foreach ($entries as $entryId) {
    entryPeer::clearInstancePool();
    flavorAssetPeer::clearInstancePool();
    mediaInfoPeer::clearInstancePool();
    $flavorAssetCriteria = new Criteria();
    $flavorAssetCriteria->add(flavorAssetPeer::STATUS, flavorAsset::FLAVOR_ASSET_STATUS_READY);
    $flavorAssetCriteria->clearSelectColumns();
    $flavorAssetCriteria->addSelectColumn(flavorAssetPeer::ID);
    $flavorAssetCriteria->add(flavorAssetPeer::ENTRY_ID, $entryId);
    $rs = flavorAssetPeer::doSelectStmt($flavorAssetCriteria, $con);
    $flavorAssets = $rs->fetchAll(PDO::FETCH_COLUMN);
    if (!count($flavorAssets)) {
        continue;
    }
    $criteria = new Criteria();
    $criteria->add(mediaInfoPeer::FLAVOR_ASSET_ID, $flavorAssets, Criteria::IN);
    $criteria->addDescendingOrderByColumn(mediaInfoPeer::ID);
    $mediaInfos = mediaInfoPeer::doSelect($criteria, $con);