Skip to content

Commit

Permalink
Remove tabs, cleanup whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
Greg Sabino Mullane authored and martinmarques committed Jun 4, 2015
1 parent ac4262e commit 8fa7b51
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions check_postgres.pl
Original file line number Diff line number Diff line change
Expand Up @@ -2305,10 +2305,10 @@ sub run_command {
if ($arg->{dbnumber} and $arg->{dbnumber} != $num) {
next;
}
## Likewise if we have specified "target" database info and this is not our choice
if ($arg->{target} and $arg->{target} != $db) {
## Likewise if we have specified "target" database info and this is not our choice
if ($arg->{target} and $arg->{target} != $db) {
next;
}
}

## Just to keep things clean:
truncate $tempfh, 0;
Expand Down Expand Up @@ -7346,9 +7346,9 @@ sub check_sequence {
FROM $seqname) foo
};
}
# Use UNION ALL to query multiple sequences at once, however if there are too many sequences this can exceed
# Use UNION ALL to query multiple sequences at once, however if there are too many sequences this can exceed
# maximum argument length; so split into chunks of 200 sequences or less and iterate over them.
while (my @seq_sql_chunk = splice @seq_sql, 0, 200) {
while (my @seq_sql_chunk = splice @seq_sql, 0, 200) {
my $seqinfo = run_command(join("\nUNION ALL\n", @seq_sql_chunk), { target => $db }); # execute all SQL commands at once
for my $r2 (@{$seqinfo->{db}[0]{slurp}}) { # now look at all results
my ($seqname, $last, $slots, $used, $percent, $left) = @$r2{qw/ seqname last_value slots used percent numleft / };
Expand All @@ -7373,7 +7373,7 @@ sub check_sequence {
push @warn => $msg;
}
}
}
}
if ($MRTG) {
my $msg = join ' | ' => map { $_->[0] } @{$seqinfo{$maxp}};
do_mrtg({one => $maxp, msg => $msg});
Expand Down

0 comments on commit 8fa7b51

Please sign in to comment.