Skip to content

Commit

Permalink
commented out update count function
Browse files Browse the repository at this point in the history
  • Loading branch information
posmena committed May 28, 2012
1 parent 2b42af5 commit 41d8dab
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions _private/scripts/processAllWGFeeds.php
@@ -0,0 +1,45 @@
<?php

include 'classes/feed_processing/class.cron_feed_manager.php';

set_time_limit(0);

$conn = new Mongo('localhost');
$db = $conn->odstech;

$feeds = $db->ot_feeds->find( {"active" => true } );
$feeds->immortal();

$i=0;
foreach( $feeds as $feed)
{
if( true )//$db->p20_products->findOne(array("feed_id" => $feed['client'])) == null )
{
$count = ODSTech_FeedManager::process($feed['client'], true);
print("Imported $count products");
if( $count > 0 )
{
//die();
}
echo("\n");
}
}

return;

// TODO - use a merge map reduce after each feed is updated so counts are correct as soon as possible
/*
$db->p20_products->mapReduce( array(
'map' => '
function () {
emit(this.feed_id, {count:1});
}'
,'reduce' => '
function (key, values) {cc
var result = {count:0};
values.forEach(function (value) {result.count += value.count;});
return result;
}') );
*/

?>

0 comments on commit 41d8dab

Please sign in to comment.