Skip to content

Commit

Permalink
tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
mickeyn committed Oct 27, 2024
1 parent 2dcf324 commit e965bc6
Show file tree
Hide file tree
Showing 16 changed files with 48 additions and 38 deletions.
8 changes: 4 additions & 4 deletions bin/author.pl
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
use v5.36;

use Cpanel::JSON::XS qw< decode_json >;
use DateTime ();
use Email::Valid ();
use Encode ();
use DateTime ();
use Email::Valid ();
use Encode ();
use Getopt::Long;
use MetaCPAN::Logger qw< :log :dlog >;
use URI ();
use URI ();

use MetaCPAN::ES;
use MetaCPAN::Ingest qw<
Expand Down
2 changes: 1 addition & 1 deletion bin/backpan.pl
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ ()
(
$undo
or exists $cpan_file_map->{$author}{$archive}
)
)
? 'cpan'
: 'backpan',
$release->{_id}
Expand Down
8 changes: 4 additions & 4 deletions bin/backup.pl
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
use Getopt::Long;
use MetaCPAN::Logger qw< :log :dlog >;
use Cpanel::JSON::XS qw< decode_json encode_json >;
use DateTime ();
use IO::Zlib ();
use Path::Tiny qw< path >;
use Try::Tiny qw< catch try >;
use DateTime ();
use IO::Zlib ();
use Path::Tiny qw< path >;
use Try::Tiny qw< catch try >;

use MetaCPAN::ES;
use MetaCPAN::Ingest qw< home >;
Expand Down
2 changes: 1 addition & 1 deletion bin/checksum.pl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use v5.36;

use Getopt::Long;
use Digest::file qw< digest_file_hex >;
use Digest::file qw< digest_file_hex >;
use MetaCPAN::Logger qw< :log :dlog >;

use MetaCPAN::ES;
Expand Down
2 changes: 1 addition & 1 deletion bin/cpan_testers.pl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
use warnings;
use v5.36;

use DBI ();
use DBI ();
use File::stat qw< stat >;
use Getopt::Long;
use IO::Uncompress::Bunzip2 qw< bunzip2 >;
Expand Down
2 changes: 1 addition & 1 deletion bin/cve.pl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Cpanel::JSON::XS qw< decode_json >;
use Getopt::Long;
use Path::Tiny qw< path >;
use Ref::Util qw< is_arrayref >;
use Ref::Util qw< is_arrayref >;

use MetaCPAN::Logger qw< :log :dlog >;

Expand Down
2 changes: 1 addition & 1 deletion bin/first.pl
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
$release
? log_debug {
"@{[ $release->name ]} by @{[ $release->author ]} was first"
}
}
: log_warn {
"no release found for distribution @{[$distribution->name]}"
};
Expand Down
6 changes: 3 additions & 3 deletions bin/latest.pl
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

use CPAN::DistnameInfo;
use Parse::CPAN::Packages::Fast;
use Ref::Util qw< is_arrayref is_hashref >;
use Ref::Util qw< is_arrayref is_hashref >;
use Regexp::Common qw< time >;
use Time::Local qw< timelocal >;
use Time::Local qw< timelocal >;

use MetaCPAN::ES;
use MetaCPAN::Ingest qw<
Expand Down Expand Up @@ -313,7 +313,7 @@ ( $bulk, $source, $status )

log_info {
$status eq 'latest' ? 'Upgrading ' : 'Downgrading ',
'release ', $release->{name}
'release ', $release->{name}
};

# Get all the files for the release.
Expand Down
2 changes: 1 addition & 1 deletion bin/queue.pl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use v5.36;

use Getopt::Long;
use Path::Tiny qw< path >;
use Path::Tiny qw< path >;
use Path::Iterator::Rule ();

use MetaCPAN::Ingest qw< minion >;
Expand Down
4 changes: 2 additions & 2 deletions bin/release.pl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use Getopt::Long;
use List::Util qw< uniq >;
use Path::Tiny qw< path >;
use Try::Tiny qw< catch try >;
use Try::Tiny qw< catch try >;

use MetaCPAN::Logger qw< :log :dlog >;

Expand Down Expand Up @@ -121,7 +121,7 @@
$find = $find->mtime( ">" . ( time - $age * 3600 ) )
if $age;
push( @files,
map { $_->{file} }
map { $_->{file} }
sort { $a->{mtime} <=> $b->{mtime} }
map { +{ file => $_, mtime => File::stat::stat($_)->mtime } }
$find->in($_) );
Expand Down
2 changes: 1 addition & 1 deletion bin/snapshot.pl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
use warnings;
use v5.36;

use Cpanel::JSON::XS qw< decode_json encode_json >;
use Cpanel::JSON::XS qw< decode_json encode_json >;
use DateTime ();
use DateTime::Format::ISO8601 ();
use HTTP::Tiny ();
Expand Down
10 changes: 5 additions & 5 deletions bin/tickets.pl
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

use MetaCPAN::Logger qw< :log :dlog >;

use Ref::Util qw< is_hashref is_ref >;
use Ref::Util qw< is_hashref is_ref >;
use HTTP::Request::Common qw< GET >;
use URI::Escape qw< uri_escape >;
use Text::CSV_XS ();
use Net::GitHub::V4 ();
use URI::Escape qw< uri_escape >;
use Text::CSV_XS ();
use Net::GitHub::V4 ();

use MetaCPAN::ES;
use MetaCPAN::Ingest qw<
Expand Down Expand Up @@ -101,7 +101,7 @@ ($tsv)
source => _rt_dist_url( $row->{dist} ),
active => $row->{active},
closed => $row->{inactive},
map { $_ => $row->{$_} + 0 }
map { $_ => $row->{$_} + 0 }
grep { not /^(dist|active|inactive)$/ }
keys %$row,
};
Expand Down
2 changes: 1 addition & 1 deletion bin/watcher.pl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
use warnings;
use v5.36;

use Cpanel::JSON::XS qw< decode_json >;
use Cpanel::JSON::XS qw< decode_json >;
use DateTime ();
use CPAN::DistnameInfo ();
use FindBin ();
Expand Down
20 changes: 15 additions & 5 deletions lib/MetaCPAN/ES.pm
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,9 @@ sub clear_type ($self) {
$self->delete_ids(@$ids);
}

sub await ( $self ) {
sub await ($self) {
my $timeout = 15;
my $iready = 0;
my $iready = 0;
my $cluster_info;
my $es = $self->{es};

Expand All @@ -158,19 +158,29 @@ sub await ( $self ) {
$iready = $es->ping;

if ($iready) {
log_info { sprintf("Awaiting %d / %d : ready", $iseconds, $timeout) };
log_info {
sprintf( "Awaiting %d / %d : ready",
$iseconds, $timeout )
};
$cluster_info = \%{ $es->info };
}
};

if ($@) {
if ( $iseconds < $timeout ) {
log_info { sprintf("Awaiting %d / %d : unavailable - sleeping ...", $iseconds, $timeout) };
log_info {
sprintf(
"Awaiting %d / %d : unavailable - sleeping ...",
$iseconds, $timeout )
};
sleep(1);
$iseconds++;
}
else {
log_info { sprintf("Awaiting %d / %d : unavailable - timeout!", $iseconds, $timeout) };
log_info {
sprintf( "Awaiting %d / %d : unavailable - timeout!",
$iseconds, $timeout )
};

#Set System Error: 112 - EHOSTDOWN - Host is down
handle_error( 112, $@, 1 );
Expand Down
2 changes: 1 addition & 1 deletion lib/MetaCPAN/File.pm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use warnings;
use v5.36;

use List::AllUtils qw< any >;
use Path::Tiny qw< path >;
use Path::Tiny qw< path >;

use MetaCPAN::Logger qw< :log :dlog >;

Expand Down
12 changes: 6 additions & 6 deletions lib/MetaCPAN/Release.pm
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ use warnings;
use v5.36;

use CPAN::Meta;
use DateTime ();
use File::Spec ();
use Module::Metadata 1.000012 (); # Improved package detection.
use Path::Tiny qw< path >;
use Plack::MIME ();
use Try::Tiny qw< catch try >;
use DateTime ();
use File::Spec ();
use Module::Metadata 1.000012 (); # Improved package detection.
use Path::Tiny qw< path >;
use Plack::MIME ();
use Try::Tiny qw< catch try >;

use MetaCPAN::Logger qw< :log :dlog >;

Expand Down

0 comments on commit e965bc6

Please sign in to comment.