Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
queue 'latest' jobs from 'release' (if queue is used)
  • Loading branch information
mickeyn committed Sep 26, 2016
1 parent 05ec1e0 commit a7e5096
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions lib/MetaCPAN/Script/Release.pm
Expand Up @@ -153,9 +153,9 @@ sub run {

eval { DB::enable_profile() };
while ( my $file = shift @files ) {
my $d = CPAN::DistnameInfo->new($file);

if ( $self->skip ) {
my $d = CPAN::DistnameInfo->new($file);
my $count = $self->index->type('release')->filter(
{
and => [
Expand All @@ -171,8 +171,14 @@ sub run {
}

if ( $self->queue ) {
$self->_add_to_queue( index_release =>
[ ( $self->latest ? '--latest' : () ), $file ] );
$self->_add_to_queue(
index_release => [$file] => { priority => 3 } );

if ( $self->latest ) {
$self->_add_to_queue(
index_latest => [ '--distribution', $d->dist ] =>
{ priority => 2 } );
}
}
else {
try { $self->import_archive($file) }
Expand Down Expand Up @@ -279,7 +285,7 @@ sub import_archive {
$document->put;

# update 'latest' (must be done _after_ last update of the document)
if ( $self->latest ) {
if ( $self->latest and !$self->queue ) {
local @ARGV = ( qw(latest --distribution), $document->distribution );
MetaCPAN::Script::Runner->run;
}
Expand Down

0 comments on commit a7e5096

Please sign in to comment.