mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-09 18:45:54 +02:00
header.pl: only get memory consumption when service is running
It probably doesn't matter much as the get_memory_consumption function just returns 0 when no pids are found. But it shouldn't even try as the mem var is never used when the service is not running. Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
committed by
Michael Tremer
parent
a66263b4f5
commit
d335cc9592
@@ -950,9 +950,6 @@ EOF
|
||||
@pids = &General::find_pids("${process}");
|
||||
}
|
||||
|
||||
# Get memory consumption
|
||||
my $mem = &General::get_memory_consumption(@pids);
|
||||
|
||||
print <<EOF;
|
||||
<tr>
|
||||
<th scope="row">
|
||||
@@ -962,6 +959,9 @@ EOF
|
||||
|
||||
# Running?
|
||||
if (scalar @pids) {
|
||||
# Get memory consumption
|
||||
my $mem = &General::get_memory_consumption(@pids);
|
||||
|
||||
# Format memory
|
||||
$mem = &General::formatBytes($mem);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user