line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Resque::Plugin::Retry; |
2
|
1
|
|
|
1
|
|
573
|
use 5.008001; |
|
1
|
|
|
|
|
4
|
|
3
|
1
|
|
|
1
|
|
4
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
16
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
38
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = "0.01"; |
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
354
|
use Resque::Plugin; |
|
1
|
|
|
|
|
404305
|
|
|
1
|
|
|
|
|
4
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
add_to job => 'Retry::Job'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
1; |
14
|
|
|
|
|
|
|
__END__ |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=encoding utf-8 |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=for html <a href="https://travis-ci.org/meru-akimbo/resque-retry-perl"><img src="https://travis-ci.org/meru-akimbo/resque-retry-perl.svg?branch=master"></a> |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=head1 NAME |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
Resque::Plugin::Retry - Retry the fail job |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=head1 SYNOPSIS |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
use Resque; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
my $resque = Resque->new(redis => $redis_server, plugins => ['Retry']); |
29
|
|
|
|
|
|
|
$resque->push('test-job' => +{ |
30
|
|
|
|
|
|
|
class => 'Hoge', |
31
|
|
|
|
|
|
|
args => [+{ cat => 'nyaaaa' }, +{ dog => 'bow' }], |
32
|
|
|
|
|
|
|
max_retry => 3, |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
); |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head1 DESCRIPTION |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
Retry when the job fails |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head1 LICENSE |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
Copyright (C) meru_akimbo. |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify |
45
|
|
|
|
|
|
|
it under the same terms as Perl itself. |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=head1 AUTHOR |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
meru_akimbo E<lt>merukatoruayu0@gmail.comE<gt> |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=cut |
52
|
|
|
|
|
|
|
|