Remove useless condition

master
Heuzef 5 years ago
parent c4520b4af3
commit 49ad181ada
  1. 18
      Check.pm

@ -135,11 +135,10 @@ my $bpc = BackupPC::Lib->new();
my $mainConf = $bpc->ConfigDataRead(); my $mainConf = $bpc->ConfigDataRead();
my $json = {}; my $json = {};
if ( $host ) { my $hostConf = $bpc->ConfigDataRead($host);
my $hostConf = $bpc->ConfigDataRead($host); my $conf = { %$mainConf, %$hostConf };
my $conf = { %$mainConf, %$hostConf }; my $age = -1;
my $age = -1; $json = {
$json = {
bkp => 0, bkp => 0,
last_age => 0, last_age => 0,
errors => 0, errors => 0,
@ -148,12 +147,12 @@ if ( $host ) {
new_size_median => 0, new_size_median => 0,
new_size_q1 => 0, new_size_q1 => 0,
new_size_q3 => 0 new_size_q3 => 0
}; };
my @bpc_info = $bpc->BackupInfoRead($host); my @bpc_info = $bpc->BackupInfoRead($host);
my $sizes = new Statistics::Descriptive::Full; my $sizes = new Statistics::Descriptive::Full;
if ( scalar( @bpc_info ) ){ if ( scalar( @bpc_info ) ){
foreach my $backup ( @bpc_info ) { foreach my $backup ( @bpc_info ) {
# Skip partial or active backups # Skip partial or active backups
next if ( $backup->{type} !~ m/^full|incr$/ ); next if ( $backup->{type} !~ m/^full|incr$/ );
@ -174,7 +173,6 @@ if ( $host ) {
$json->{new_size_q3} = eval { int $sizes->quantile(3) } || 0; $json->{new_size_q3} = eval { int $sizes->quantile(3) } || 0;
$json->{age} = time - $bpc_info[$i]->{startTime}; $json->{age} = time - $bpc_info[$i]->{startTime};
$json->{last_age} = sprintf("%.1f", ($json->{age}) / 84600); $json->{last_age} = sprintf("%.1f", ($json->{age}) / 84600);
}
} }
# TOO BIG ? # TOO BIG ?

Loading…
Cancel
Save