| 1 | package App::MadEye::Plugin::Worker::Simple; | ||||||||||
| 2 | 2 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 2 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 2 | ▶ | use base qw/App::MadEye::Plugin::Base/; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 2 | ▶ | use App::MadEye::Util; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 2 | ▶ | use Params::Validate; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | 0 | ▶ | sub run_job :Method { | ||||||||
|
Subroutine
run_job: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||
| 9 | 0 | my ($self, $context, $args) = @_; | |||||||||
| 10 | |||||||||||
| 11 | 0 | $context->log( debug => "watching $args->{target} by $args->{plugin}" ); | |||||||||
| 12 | |||||||||||
| 13 | 0 | ▶ | my $timeout = $self->config->{config}->{task_timeout} or die "missing task_timeout"; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 14 | |||||||||||
| 15 | 0 | ▶ | my $error = timeout $timeout, "watching $args->{target} $args->{plugin}", sub { | ||||||||
|
Subroutine
__ANON__: not called CC=2 SCAR=17.9
| |||||||||||
| 16 | 0 | ▶ | if ( my $message = $args->{plugin}->is_dead( $args->{target} ) ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 17 | $context->add_result( | ||||||||||
| 18 | plugin => $args->{plugin}, | ||||||||||
| 19 | target => $args->{target}, | ||||||||||
| 20 | 0 | message => $message, | |||||||||
| 21 | ); | ||||||||||
| 22 | } | ||||||||||
| 23 | 0 | }; | |||||||||
| 24 | |||||||||||
| 25 | 0 | ▶ | if ($error) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 26 | $context->add_result( | ||||||||||
| 27 | plugin => $args->{plugin}, | ||||||||||
| 28 | target => $args->{target}, | ||||||||||
| 29 | 0 | message => $error, | |||||||||
| 30 | ); | ||||||||||
| 31 | } | ||||||||||
| 32 | |||||||||||
| 33 | 0 | $context->log( debug => "finished $args->{target} by $args->{plugin}" ); | |||||||||
| 34 | 2 | ▶ | } | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 35 | |||||||||||
| 36 | 2 | 1; | |||||||||
| 37 | __END__ | ||||||||||