line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Qudo::Hook::Notify::ReachMaxRetry; |
2
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
132
|
|
3
|
1
|
|
|
1
|
|
7
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
70
|
|
4
|
1
|
|
|
1
|
|
6
|
use base 'Qudo::Hook'; |
|
1
|
|
|
|
|
17
|
|
|
1
|
|
|
|
|
1258
|
|
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_reach_max_retry'} = sub { |
12
|
0
|
|
|
0
|
|
|
my $job = shift; |
13
|
|
|
|
|
|
|
|
14
|
0
|
0
|
0
|
|
|
|
if ($job->is_failed && ( $job->funcname->max_retries <= ($job->retry_cnt) )) { |
15
|
0
|
|
|
|
|
|
$klass->plugin->{logger}->emergency( |
16
|
|
|
|
|
|
|
sprintf('%s already retry max!!',$job->funcname) |
17
|
|
|
|
|
|
|
); |
18
|
|
|
|
|
|
|
} |
19
|
0
|
|
|
|
|
|
}; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub unload { |
23
|
0
|
|
|
0
|
0
|
|
my ($class, $klass) = @_; |
24
|
|
|
|
|
|
|
|
25
|
0
|
|
|
|
|
|
delete $klass->hooks->{post_work}->{'notify_reach_max_retry'}; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
1; |
30
|
|
|
|
|
|
|
__END__ |