line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Qudo::Hook::Notify::Failed; |
2
|
1
|
|
|
1
|
|
8
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
47
|
|
3
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
39
|
|
4
|
1
|
|
|
1
|
|
6
|
use base 'Qudo::Hook'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
1436
|
|
5
|
|
|
|
|
|
|
|
6
|
0
|
|
|
0
|
0
|
|
sub hook_point { 'post_work' } |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub load { |
9
|
0
|
|
|
0
|
0
|
|
my ($class, $klass) = @_; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
$klass->hooks->{post_work}->{'notify_failed'} = sub { |
12
|
0
|
|
|
0
|
|
|
my $job = shift; |
13
|
0
|
0
|
|
|
|
|
if ($job->is_failed) { |
14
|
0
|
|
|
|
|
|
$klass->plugin->{logger}->emergency( |
15
|
|
|
|
|
|
|
sprintf('%s is failed!!',$job->funcname) |
16
|
|
|
|
|
|
|
); |
17
|
|
|
|
|
|
|
} |
18
|
0
|
|
|
|
|
|
}; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub unload { |
22
|
0
|
|
|
0
|
0
|
|
my ($class, $klass) = @_; |
23
|
|
|
|
|
|
|
|
24
|
0
|
|
|
|
|
|
delete $klass->hooks->{post_work}->{'notify_failed'}; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
1; |
29
|
|
|
|
|
|
|
__END__ |