line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package PkgForge::Daemon::Incoming; # -*-perl-*- |
2
|
1
|
|
|
1
|
|
2246
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
41
|
|
3
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
54
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
# $Id: Incoming.pm.in 14914 2010-12-01 09:41:14Z squinney@INF.ED.AC.UK $ |
6
|
|
|
|
|
|
|
# $Source:$ |
7
|
|
|
|
|
|
|
# $Revision: 14914 $ |
8
|
|
|
|
|
|
|
# $HeadURL: https://svn.lcfg.org/svn/source/tags/PkgForge-Server/PkgForge_Server_1_1_10/lib/PkgForge/Daemon/Incoming.pm.in $ |
9
|
|
|
|
|
|
|
# $Date: 2010-12-01 09:41:14 +0000 (Wed, 01 Dec 2010) $ |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $VERSION = '1.1.10'; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
my $PLEASE_STOP = 0; |
14
|
|
|
|
|
|
|
|
15
|
1
|
|
|
1
|
|
7
|
use Moose; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
8
|
|
16
|
1
|
|
|
1
|
|
7172
|
use MooseX::Types::Moose qw(Int); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
12
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
extends 'PkgForge::Daemon', 'PkgForge::Handler::Incoming'; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
has 'poll' => ( |
21
|
|
|
|
|
|
|
is => 'ro', |
22
|
|
|
|
|
|
|
isa => Int, |
23
|
|
|
|
|
|
|
default => 60, |
24
|
|
|
|
|
|
|
required => 1, |
25
|
|
|
|
|
|
|
documentation => 'Interval (in seconds) to wait between queue runs', |
26
|
|
|
|
|
|
|
); |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
override 'shutdown' => sub { |
29
|
|
|
|
|
|
|
my ($self) = @_; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
$self->logger->notice('Handling shutdown request'); |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
$PLEASE_STOP = 1; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
return; |
36
|
|
|
|
|
|
|
}; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
after 'start' => sub { |
39
|
|
|
|
|
|
|
my ($self) = @_; |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
$self->logger->notice('Starting incoming queue processing daemon'); |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
$self->preflight(); |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
while ( !$PLEASE_STOP ) { |
46
|
|
|
|
|
|
|
$self->logger->notice('Processing queue'); |
47
|
|
|
|
|
|
|
$self->execute(); |
48
|
|
|
|
|
|
|
$self->logger->notice('Finished processing queue'); |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
if ( !$PLEASE_STOP ) { |
51
|
|
|
|
|
|
|
sleep $self->poll; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
$self->logger->notice('Stopping incoming queue processing daemon'); |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
exit 0; |
58
|
|
|
|
|
|
|
}; |
59
|
|
|
|
|
|
|
|
60
|
1
|
|
|
1
|
|
5765
|
no Moose; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
6
|
|
61
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
1; |
64
|
|
|
|
|
|
|
__END__ |