fix: die if redis isn't available
This commit is contained in:
@@ -10,6 +10,15 @@ use Urupam::Version;
|
|||||||
sub startup {
|
sub startup {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
|
my $db = Urupam::DB->new;
|
||||||
|
my $ping_error;
|
||||||
|
$db->ping->catch(
|
||||||
|
sub {
|
||||||
|
$ping_error = shift;
|
||||||
|
}
|
||||||
|
)->wait;
|
||||||
|
die("Cannot connect to Redis database: $ping_error\n") if ($ping_error);
|
||||||
|
|
||||||
$self->helper(
|
$self->helper(
|
||||||
db => sub {
|
db => sub {
|
||||||
my $c = shift;
|
my $c = shift;
|
||||||
|
|||||||
Reference in New Issue
Block a user