Skip to content

Commit

Permalink
Extract timeout method
Browse files Browse the repository at this point in the history
  • Loading branch information
pjcj committed May 5, 2024
1 parent 591168d commit 0fde0fa
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/Devel/Cover/Collection.pm
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,14 @@ sub BUILDARGS ($class, %args) { {
%args,
} }

sub get_timeout ($self) { $self->local_timeout || $self->timeout || 30 * 60 }

# display $non_buffered characters, then buffer
sub _sys ($self, $non_buffered, @command) {
# system @command; return ".";
my ($output1, $output2) = ("", "");
$output1 = "dc -> @command\n" if $self->verbose;
my $timeout = $self->local_timeout || $self->timeout || 30 * 60;
my $timeout = $self->get_timeout;
my $max = 4e4;
# say "Setting alarm for $timeout seconds";
my $ok = 0;
Expand Down Expand Up @@ -476,7 +478,7 @@ sub cover_modules ($self) {
return unless $self->force;
}

my $timeout = $self->local_timeout || $self->timeout || 30 * 60;
my $timeout = $self->get_timeout;
# say "Setting alarm for $timeout seconds";
my $name = sprintf("%s-%18.6f", $module, time) =~ tr/a-zA-Z0-9_./-/cr;
say "$dir -> $name";
Expand Down

0 comments on commit 0fde0fa

Please sign in to comment.