Skip to content

Commit 47349eb

Browse files
committed
Merge pull request metacpan#464 from CPAN-API/leo/cleanup_mirrors
Cleanup PC policy, fix mirrors to delete first metacpan#463
2 parents fcf3166 + fd27271 commit 47349eb

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

.perlcriticrc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ verbose = 11
1111
[-RegularExpressions::RequireExtendedFormatting]
1212
[-RegularExpressions::RequireLineBoundaryMatching]
1313
[-Subroutines::ProhibitExplicitReturnUndef]
14-
[-ValuesAndExpressions::ProhibitAccessOfPrivateData]
1514
[-ValuesAndExpressions::ProhibitNoisyQuotes]
1615
[-Variables::ProhibitPunctuationVars]
1716

lib/MetaCPAN/Script/Mirrors.pm

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,13 @@ sub index_mirrors {
2222
my $ua = LWP::UserAgent->new;
2323
log_info { 'Getting mirrors.json file from ' . $self->cpan };
2424

25-
my $json = $self->cpan->file( 'indices', 'mirrors.json' )->slurp;
26-
my $type = $self->index->type('mirror');
25+
my $json = $self->cpan->file( 'indices', 'mirrors.json' )->slurp;
26+
my $type = $self->index->type('mirror');
27+
28+
# Clear out everything in the index
29+
# so don't end up with old mirrors
30+
$type->delete;
31+
2732
my $mirrors = Cpanel::JSON::XS::decode_json($json);
2833
foreach my $mirror (@$mirrors) {
2934
$mirror->{location}

0 commit comments

Comments
 (0)