From 51945a611155ff686e810bcb26d0de154e7e86bc Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Fri, 6 Dec 2019 12:22:32 +0100 Subject: [PATCH] VolatileState: Swallow exceptions The web interface must remain accessible if the connection to the Icinga Redis fails. --- library/Icingadb/Model/Behavior/VolatileState.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/library/Icingadb/Model/Behavior/VolatileState.php b/library/Icingadb/Model/Behavior/VolatileState.php index 0d4702af..26df7190 100644 --- a/library/Icingadb/Model/Behavior/VolatileState.php +++ b/library/Icingadb/Model/Behavior/VolatileState.php @@ -2,6 +2,7 @@ namespace Icinga\Module\Icingadb\Model\Behavior; +use Exception; use Icinga\Module\Icingadb\Common\IcingaRedis; use Icinga\Module\Icingadb\Redis\VolatileState as RedisState; use ipl\Orm\Contract\RetrieveBehavior; @@ -24,6 +25,10 @@ class VolatileState implements RetrieveBehavior public function retrieve(Model $model) { - $this->getVolatileState()->fetch($model); + try { + $this->getVolatileState()->fetch($model); + } catch (Exception $e) { + // Pass + } } }