Skip to content

Commit

Permalink
IcingaRedis: Don't throw in method isUnavailable
Browse files Browse the repository at this point in the history
fixes #883
  • Loading branch information
nilmerg committed Sep 27, 2023
1 parent f6e808b commit cd41a20
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions library/Icingadb/Common/IcingaRedis.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,12 @@ public static function isUnavailable(): bool
{
$self = self::instance();

if ($self->redis === null) {
$self->getConnection();
if (! $self->redisUnavailable && $self->redis === null) {
try {
$self->getConnection();
} catch (Exception $_) {
// getConnection already logs the error
}
}

return $self->redisUnavailable;
Expand Down

0 comments on commit cd41a20

Please sign in to comment.