| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Beam::Minion::Command::job; |
|
2
|
|
|
|
|
|
|
our $VERSION = '0.014'; |
|
3
|
|
|
|
|
|
|
# ABSTRACT: Command to manage minion jobs |
|
4
|
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
#pod =head1 SYNOPSIS |
|
6
|
|
|
|
|
|
|
#pod |
|
7
|
|
|
|
|
|
|
#pod beam minion job [-R] [-f] [--remove] [-S ] [-q ] |
|
8
|
|
|
|
|
|
|
#pod [-t ] [-w] [-l ] [-o ] [] |
|
9
|
|
|
|
|
|
|
#pod |
|
10
|
|
|
|
|
|
|
#pod =head1 DESCRIPTION |
|
11
|
|
|
|
|
|
|
#pod |
|
12
|
|
|
|
|
|
|
#pod This command manages the minion queue, lists jobs, lists workers, and |
|
13
|
|
|
|
|
|
|
#pod allows re-running failed jobs. |
|
14
|
|
|
|
|
|
|
#pod |
|
15
|
|
|
|
|
|
|
#pod =head1 ARGUMENTS |
|
16
|
|
|
|
|
|
|
#pod |
|
17
|
|
|
|
|
|
|
#pod =head2 |
|
18
|
|
|
|
|
|
|
#pod |
|
19
|
|
|
|
|
|
|
#pod The ID of a job or worker (with the C<-w> option) to display. |
|
20
|
|
|
|
|
|
|
#pod |
|
21
|
|
|
|
|
|
|
#pod =head1 OPTIONS |
|
22
|
|
|
|
|
|
|
#pod |
|
23
|
|
|
|
|
|
|
#pod =head2 C<-R> C<--retry> |
|
24
|
|
|
|
|
|
|
#pod |
|
25
|
|
|
|
|
|
|
#pod Retry the given job by putting it back in the queue. See C<-f> to retry |
|
26
|
|
|
|
|
|
|
#pod the job in the current process. |
|
27
|
|
|
|
|
|
|
#pod |
|
28
|
|
|
|
|
|
|
#pod =head2 C<-f> C<--foreground> |
|
29
|
|
|
|
|
|
|
#pod |
|
30
|
|
|
|
|
|
|
#pod Retry the given jobs right away in the current process (useful for |
|
31
|
|
|
|
|
|
|
#pod debugging). See C<-R> to retry the job in the queue. |
|
32
|
|
|
|
|
|
|
#pod |
|
33
|
|
|
|
|
|
|
#pod =head2 C<--remove> |
|
34
|
|
|
|
|
|
|
#pod |
|
35
|
|
|
|
|
|
|
#pod Remove the given job(s) from the database. |
|
36
|
|
|
|
|
|
|
#pod |
|
37
|
|
|
|
|
|
|
#pod =head2 C<< -S >> C<< --state >> |
|
38
|
|
|
|
|
|
|
#pod |
|
39
|
|
|
|
|
|
|
#pod Only show jobs with the given C. The state can be one of: C, |
|
40
|
|
|
|
|
|
|
#pod C, C, or C. |
|
41
|
|
|
|
|
|
|
#pod |
|
42
|
|
|
|
|
|
|
#pod =head2 C<< -q >> C<< --queue >> |
|
43
|
|
|
|
|
|
|
#pod |
|
44
|
|
|
|
|
|
|
#pod Only show jobs in the given C. Defaults to showing jobs in all queues. |
|
45
|
|
|
|
|
|
|
#pod The default queue for new jobs is C. |
|
46
|
|
|
|
|
|
|
#pod |
|
47
|
|
|
|
|
|
|
#pod =head2 C<< -t >> C<< --task >> |
|
48
|
|
|
|
|
|
|
#pod |
|
49
|
|
|
|
|
|
|
#pod Only show jobs matching the given C. L task names are |
|
50
|
|
|
|
|
|
|
#pod C<< : >>. |
|
51
|
|
|
|
|
|
|
#pod |
|
52
|
|
|
|
|
|
|
#pod =head2 C<-w> C<--workers> |
|
53
|
|
|
|
|
|
|
#pod |
|
54
|
|
|
|
|
|
|
#pod List workers instead of jobs. |
|
55
|
|
|
|
|
|
|
#pod |
|
56
|
|
|
|
|
|
|
#pod =head2 C<< -l >> C<< --limit >> |
|
57
|
|
|
|
|
|
|
#pod |
|
58
|
|
|
|
|
|
|
#pod Limit the list to C entries. Defaults to 100. |
|
59
|
|
|
|
|
|
|
#pod |
|
60
|
|
|
|
|
|
|
#pod =head2 C<< -o >> C<< --offset >> |
|
61
|
|
|
|
|
|
|
#pod |
|
62
|
|
|
|
|
|
|
#pod Skip C jobs when listing. Defaults to 0. |
|
63
|
|
|
|
|
|
|
#pod |
|
64
|
|
|
|
|
|
|
#pod =head1 ENVIRONMENT |
|
65
|
|
|
|
|
|
|
#pod |
|
66
|
|
|
|
|
|
|
#pod =head2 BEAM_MINION |
|
67
|
|
|
|
|
|
|
#pod |
|
68
|
|
|
|
|
|
|
#pod This variable defines the shared database to coordinate the Minion workers. This |
|
69
|
|
|
|
|
|
|
#pod database is used to queue the job. This must be the same for all workers |
|
70
|
|
|
|
|
|
|
#pod and every job running. |
|
71
|
|
|
|
|
|
|
#pod |
|
72
|
|
|
|
|
|
|
#pod See L for how to set this variable. |
|
73
|
|
|
|
|
|
|
#pod |
|
74
|
|
|
|
|
|
|
#pod =head1 SEE ALSO |
|
75
|
|
|
|
|
|
|
#pod |
|
76
|
|
|
|
|
|
|
#pod L, L |
|
77
|
|
|
|
|
|
|
#pod |
|
78
|
|
|
|
|
|
|
#pod =cut |
|
79
|
|
|
|
|
|
|
|
|
80
|
1
|
|
|
1
|
|
55181
|
use strict; |
|
|
1
|
|
|
|
|
7
|
|
|
|
1
|
|
|
|
|
21
|
|
|
81
|
1
|
|
|
1
|
|
3
|
use warnings; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
20
|
|
|
82
|
1
|
|
|
1
|
|
417
|
use Beam::Minion::Util qw( build_mojo_app ); |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
62
|
|
|
83
|
1
|
|
|
1
|
|
371
|
use Minion::Command::minion::job; |
|
|
1
|
|
|
|
|
1234
|
|
|
|
1
|
|
|
|
|
6
|
|
|
84
|
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
sub run { |
|
86
|
2
|
|
|
2
|
0
|
4520
|
my ( $class, @args ) = @_; |
|
87
|
2
|
|
|
|
|
7
|
my $app = build_mojo_app(); |
|
88
|
1
|
|
|
|
|
17
|
my $cmd = Minion::Command::minion::job->new( app => $app ); |
|
89
|
1
|
|
|
|
|
13
|
$cmd->run( @args ); |
|
90
|
|
|
|
|
|
|
} |
|
91
|
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
1; |
|
93
|
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
__END__ |