line |
true |
false |
branch |
20
|
5 |
0 |
if $_[0]->cleanup |
23
|
0 |
0 |
unless -r (my $file = path((shift())->pid_file)) |
28
|
0 |
0 |
if $pid and kill 0, $pid |
39
|
0 |
0 |
if -e (my $file = path($self->pid_file)) |
42
|
0 |
0 |
eval {
do {
$file->spew("$pid\n")->chmod(420)
}
} ? : |
|
0 |
0 |
if (my $err = eval {
do {
$file->spew("$pid\n")->chmod(420)
}
} ? undef : $@) |
43
|
0 |
0 |
if $self->app->log->error(qq[Can't create process id file "$file": $err]) |
57
|
0 |
0 |
if $Mojo::Server::Prefork::Config{'d_pseudofork'} |
60
|
0 |
0 |
unless pipe $self->{'reader'}, $self->{'writer'} |
70
|
0 |
0 |
$self->workers > 0 ? : |
71
|
0 |
0 |
unless $w->{'graceful'} |
82
|
0 |
0 |
unless +(shift())->{'writer'}->syswrite("$$:$_[0]\n") |
88
|
0 |
0 |
if (not $self->{'finished'}) { } |
|
0 |
0 |
elsif (not keys %{$$self{'pool'};}) { } |
91
|
0 |
0 |
$graceful > $spare ? : |
|
0 |
0 |
$graceful ? : |
110
|
0 |
0 |
unless my $w = $self->{'pool'}{$pid} |
114
|
0 |
0 |
if not $w->{'graceful'} and $w->{'time'} + $interval + $ht <= $time |
117
|
0 |
0 |
$self->{'graceful'} ? : |
119
|
0 |
0 |
if $graceful and not $w->{'quit'}++ |
120
|
0 |
0 |
if $graceful and $graceful + $gt <= $time |
124
|
0 |
0 |
if $w->{'force'} or $self->{'finished'} and not $graceful |
132
|
0 |
0 |
unless defined(my $pid = fork) |
133
|
0 |
0 |
if $pid |
159
|
0 |
0 |
unless my $w = delete $self->{'pool'}{$pid} |
163
|
0 |
0 |
unless $w->{'healthy'} |
176
|
0 |
0 |
unless Mojo::Util::_readable(1000, fileno $reader) |
177
|
0 |
0 |
unless $reader->sysread(my $chunk, 4194304) |
182
|
0 |
0 |
unless my $w = $self->{'pool'}{$1} |
183
|
0 |
0 |
if @$w{"healthy", "time"} = (1, $time) |
184
|
0 |
0 |
if ($2) |