Logging and whitespace
This commit is contained in:
parent
64bdf40e86
commit
6af8f0d419
|
@ -257,6 +257,8 @@ sub run {
|
|||
}
|
||||
|
||||
my $fd = 0;
|
||||
|
||||
# This also closes dbh and CLIENT and SERVER
|
||||
while( $fd < POSIX::sysconf(&POSIX::_SC_OPEN_MAX) ) {
|
||||
POSIX::close($fd++);
|
||||
}
|
||||
|
@ -300,16 +302,17 @@ sub run {
|
|||
|
||||
if ( $Config{ZM_SERVER_ID} ) {
|
||||
if ( ! ( $secs_count % 60 ) ) {
|
||||
Debug("Connecting");
|
||||
while ( (!$zm_terminate) and !($dbh and $dbh->ping()) ) {
|
||||
Warning("Not connected to db ($dbh)".($dbh?' ping('.$dbh->ping().')':''). ($DBI::errstr?" errstr($DBI::errstr)":'').' Reconnecting');
|
||||
$dbh = zmDbConnect();
|
||||
}
|
||||
last if $zm_terminate;
|
||||
|
||||
my @cpuload = CpuLoad();
|
||||
Debug("Updating Server record @cpuload");
|
||||
if ( ! defined $dbh->do(q{UPDATE Servers SET Status=?,CpuLoad=?,TotalMem=?,FreeMem=?,TotalSwap=?,FreeSwap=? WHERE Id=?}, undef,
|
||||
'Running', $cpuload[0], &totalmem, &freemem, &totalswap, &freeswap, $Config{ZM_SERVER_ID} ) ) {
|
||||
Error("Failed Updating status of Server record for Id=$Config{ZM_SERVER_ID}".$dbh->errstr());
|
||||
Error("Failed Updating status of Server record for Id=$Config{ZM_SERVER_ID} :".$dbh->errstr());
|
||||
}
|
||||
}
|
||||
$secs_count += 1;
|
||||
|
@ -709,7 +712,7 @@ sub reaper {
|
|||
$process->{delay} = $Config{ZM_MAX_RESTART_DELAY};
|
||||
}
|
||||
}
|
||||
Debug("Delay for $$process{command} is now $$process{delay}");
|
||||
#Debug("Delay for $$process{command} is now $$process{delay}");
|
||||
} else {
|
||||
delete $cmd_hash{$$process{command}};
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue