Open antyale opened 8 years ago
In the following sub, shouldn't it return ERROR at the end by default and just OK when it is OK for sure?
sub ping { my $self = shift; try { unless (defined $self->db()) { $self->_connect_db(); } unless($self->db->do('delete from dod_dbmon.ping') == 1) { $self->log->debug('Problem deleting entry from ping table'); $self->log->debug("Database seems UP but not responsive"); return $ERROR; }; unless($self->db->do('insert into dod_dbmon.ping values (curdate(), curtime())') == 1) { $self->log->debug('Problem inserting entry into ping table'); $self->log->debug("Database seems UP but not responsive"); return $ERROR; } $self->log->debug("Database is UP and responsive"); return $OK; } catch { $self->log->error("Problem connecting to database. DB object:"); $self->log->debug( Dumper $self->db() ); return $ERROR; }; return $OK; }
In the following sub, shouldn't it return ERROR at the end by default and just OK when it is OK for sure?