Skip to content

Commit 8b0290f

Browse files
authored
Merge pull request #898 from metacpan/mickey/use_count
Script::Release: use S::Es count for checking existence
2 parents 025a6ff + 6ef13c4 commit 8b0290f

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed

lib/MetaCPAN/Script/Release.pm

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -161,15 +161,22 @@ sub run {
161161
my $d = CPAN::DistnameInfo->new($file);
162162

163163
if ( $self->skip ) {
164-
my $count = $self->index->type('release')->filter(
165-
{
166-
and => [
167-
{ term => { archive => $d->filename } },
168-
{ term => { author => $d->cpanid } },
169-
]
170-
}
171-
)->raw->count;
172-
if ($count) {
164+
my $count = $self->es->count(
165+
index => $self->index->name,
166+
type => 'release',
167+
body => {
168+
query => {
169+
bool => {
170+
must => [
171+
{ term => { archive => $d->filename } },
172+
{ term => { author => $d->cpanid } },
173+
]
174+
}
175+
}
176+
},
177+
);
178+
179+
if ( $count->{count} ) {
173180
log_info {"Skipping $file"};
174181
next;
175182
}

0 commit comments

Comments
 (0)