Skip to content

Commit

Permalink
Cleanup PC policy, fix mirrors to delete first #463
Browse files Browse the repository at this point in the history
  • Loading branch information
ranguard committed Apr 26, 2016
1 parent 9af01ef commit fd27271
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
1 change: 0 additions & 1 deletion .perlcriticrc
Expand Up @@ -11,7 +11,6 @@ verbose = 11
[-RegularExpressions::RequireExtendedFormatting]
[-RegularExpressions::RequireLineBoundaryMatching]
[-Subroutines::ProhibitExplicitReturnUndef]
[-ValuesAndExpressions::ProhibitAccessOfPrivateData]
[-ValuesAndExpressions::ProhibitNoisyQuotes]
[-Variables::ProhibitPunctuationVars]

Expand Down
9 changes: 7 additions & 2 deletions lib/MetaCPAN/Script/Mirrors.pm
Expand Up @@ -22,8 +22,13 @@ sub index_mirrors {
my $ua = LWP::UserAgent->new;
log_info { 'Getting mirrors.json file from ' . $self->cpan };

my $json = $self->cpan->file( 'indices', 'mirrors.json' )->slurp;
my $type = $self->index->type('mirror');
my $json = $self->cpan->file( 'indices', 'mirrors.json' )->slurp;
my $type = $self->index->type('mirror');

# Clear out everything in the index
# so don't end up with old mirrors
$type->delete;

my $mirrors = Cpanel::JSON::XS::decode_json($json);
foreach my $mirror (@$mirrors) {
$mirror->{location}
Expand Down

0 comments on commit fd27271

Please sign in to comment.