Skip to content

Commit

Permalink
Removed unused method
Browse files Browse the repository at this point in the history
The use of the no_latest method ws removed in aab539f
  • Loading branch information
mickeyn committed Jun 18, 2017
1 parent bedb887 commit bf5a72c
Showing 1 changed file with 0 additions and 44 deletions.
44 changes: 0 additions & 44 deletions lib/MetaCPAN/Web/Model/API/Release.pm
Expand Up @@ -331,50 +331,6 @@ sub topuploaders {
$self->request( '/release/top_uploaders', undef, $param );
}

sub no_latest {
my ( $self, @distributions ) = @_;

# If there are no distributions return
return Future->done( {} ) unless (@distributions);

@distributions = uniq @distributions;
$self->request(
'/release/_search',
{
size => scalar @distributions,
query => {
bool => {
must => [
{ terms => { distribution => \@distributions } },
{ term => { status => 'latest' } }
]
}
},
fields => [qw(distribution status)]
}
)->transform(
done => sub {
my $data = shift;
my @latest
= map { $_->{fields}->{distribution} }
@{ $data->{hits}->{hits} };
return (
{
took => $data->{took},
no_latest => {
map {
my $distro = $_;
( first { $_ eq $distro } @latest )
? ()
: ( $distro, 1 );
} @distributions
}
}
);
}
);
}

__PACKAGE__->meta->make_immutable;

1;

0 comments on commit bf5a72c

Please sign in to comment.