Martian/Server.pm

filter: Statementstmt 100% 6 / 6 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 2 / 2 Podpod n/a totaltotal 100% 8 / 8 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Martian.pm ↑ Summary
1 package Martian::Server;
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use base 'Starman::Server';
Subroutine BEGIN: called CC=1 SCAR=0.0
5 use BSD::Resource;
6  
7 sub done
8 {
9 my $self = shift;
10 return 1 if $self->SUPER::done(@_);
11 my $rus = getrusage();
12 my $memory_soft_cap = $self->{options}->{memory_limit} // 148680;
13 if ( $rus->{maxrss} >= $memory_soft_cap ) {
14 $self->log(2, "Maximum memory exceeded, this child will not serve more requests");
15 return 1 ;
16 }
17  
18 return 0;
19 }
20  
21 1;
22  
23 __END__
« Martian.pm ↑ Summary