Permalink
Browse files

add a min file count option

  • Loading branch information...
1 parent 9e0d81c commit 0773671a3566a25ab07de350769830098e24420e @rjbs rjbs committed Aug 13, 2011
Showing with 8 additions and 1 deletion.
  1. +1 −0 lib/PAUSE.pm
  2. +7 −1 lib/PAUSE/mldistwatch.pm
View
@@ -77,6 +77,7 @@ $PAUSE::Config ||=
MAXRETRIES => 16,
MIRRORCONFIG => '/usr/local/mirror/mymirror.config',
MLROOT => '/home/ftp/pub/PAUSE/authors/id/', # originally module list root
+ ML_MIN_FILES => 20_000, # must be this many files to run mldistwatch
MOD_DATA_SOURCE_NAME => "dbi:mysql:mod",
NO_SUCCESS_BREAK => 900,
P5P => 'release-announce@perl.org',
@@ -386,6 +386,12 @@ sub manifind {
return \%found;
}
+sub _newcountokay {
+ my ($self, $count) = @_;
+ my $MIN = $PAUSE::Config->{ML_MIN_FILES};
+ return $count >= $MIN;
+}
+
sub checkfornew {
my($self,$testdir) = @_;
local $/ = "";
@@ -409,7 +415,7 @@ sub checkfornew {
}
my $all = scalar @all;
die "Panic: unusual small number of files involved ($all)"
- if !$self->{PICK} && $all < 20000;
+ if !$self->{PICK} && ! $self->_newcountokay($all);
$self->verbose(2, "Starting BIGLOOP over $all files\n");
BIGLOOP: for (my $i=0;scalar @all;$self->empty_dir($testdir)) {
my $dist = shift @all;

0 comments on commit 0773671

Please sign in to comment.