Skip to content

Commit

Permalink
Item10994: taint error, NUM_INDEXES
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.foswiki.org/trunk/MongoDBPlugin@12705 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
PaulHarvey authored and PaulHarvey committed Oct 4, 2011
1 parent 74d537b commit 7bb0682
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions lib/Foswiki/Plugins/MongoDBPlugin.pm
Expand Up @@ -177,6 +177,8 @@ sub _update {
my @topicList = Foswiki::Func::getTopicList($web);
print STDERR "FORKING a new /MongoDBPlugin/update for $web ($#topicList) -revision=$importTopicRevisions\n";
my $cmd = "time ./rest /MongoDBPlugin/update -updateweb=$web -revision=$importTopicRevisions -recurse=0";
$cmd =~ /^(.*$)/;
$cmd = $1;
print STDERR `$cmd 2>&1`;
} else {
$result .= updateWebCache( $web, $importTopicRevisions );
Expand Down
5 changes: 3 additions & 2 deletions lib/Foswiki/Plugins/MongoDBPlugin/DB.pm
Expand Up @@ -40,6 +40,7 @@ $MongoDB::Cursor::slave_okay = 1;
#use constant MONITOR => $Foswiki::cfg{MONITOR}{'Foswiki::Plugins::MongoDBPlugin'} || 0;
use constant MONITOR => 0;
use constant MONITOR_INDEX => 0;
my $MAX_NUM_INDEXES = 56;

sub new {
my $class = shift;
Expand Down Expand Up @@ -291,9 +292,9 @@ sub ensureIndex {
return;
}
}
if ( scalar( @{ $self->{mongoDBIndexes} } ) >= 40 ) {
if ( scalar( @{ $self->{mongoDBIndexes} } ) >= $MAX_NUM_INDEXES ) {
print STDERR
"*******************ouch. MongoDB can only have 40 indexes per collection : "
"*******************ouch. MongoDB can only have $MAX_NUM_INDEXES indexes per collection : "
. $options->{name} . "\n"
if MONITOR_INDEX;
return;
Expand Down

0 comments on commit 7bb0682

Please sign in to comment.