fix: die if redis isn't available

This commit is contained in:
2026-02-14 19:05:28 +01:00
parent d59b9cf837
commit 4eb2939be4

View File

@@ -10,6 +10,15 @@ use Urupam::Version;
sub startup {
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(
db => sub {
my $c = shift;