1
0
mirror of https://gitlab.com/depesz/explain.depesz.com.git synced 2025-07-03 00:58:12 +02:00

Implement /status to show if db is accessible

This commit is contained in:
Hubert depesz Lubaczewski
2018-06-11 20:56:49 +02:00
parent c409a2ad48
commit 00d63257bb
3 changed files with 17 additions and 0 deletions

View File

@ -412,6 +412,15 @@ sub info {
}
sub status {
my $self = shift;
if ($self->database->ping()) {
$self->render('text' => 'OK', status => 200);
} else {
$self->render('text' => 'DB FAILED', status => 500);
}
}
sub help {
# direct to template