From b397e1e05dc54f7f859af79b3bd69f8b752ec026 Mon Sep 17 00:00:00 2001 From: Sukhwinder Dhillon Date: Fri, 27 Feb 2026 11:07:54 +0100 Subject: [PATCH 1/2] RetryConnection: Ensure ipl forward compatibility --- library/Reporting/RetryConnection.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/library/Reporting/RetryConnection.php b/library/Reporting/RetryConnection.php index bf13c57..9fa3d89 100644 --- a/library/Reporting/RetryConnection.php +++ b/library/Reporting/RetryConnection.php @@ -6,10 +6,11 @@ namespace Icinga\Module\Reporting; use ipl\Sql\Connection; +use PDOStatement; class RetryConnection extends Connection { - public function prepexec($stmt, $values = null) + public function prepexec($stmt, $values = null): PDOStatement { try { $sth = parent::prepexec($stmt, $values); From c61ab8b593221ded4544cbf1c4c69441847fa6bd Mon Sep 17 00:00:00 2001 From: Sukhwinder Dhillon Date: Fri, 20 Mar 2026 18:04:10 +0100 Subject: [PATCH 2/2] Simplify FQN --- library/Reporting/RetryConnection.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/library/Reporting/RetryConnection.php b/library/Reporting/RetryConnection.php index 9fa3d89..023fcac 100644 --- a/library/Reporting/RetryConnection.php +++ b/library/Reporting/RetryConnection.php @@ -5,6 +5,7 @@ namespace Icinga\Module\Reporting; +use Exception; use ipl\Sql\Connection; use PDOStatement; @@ -14,7 +15,7 @@ public function prepexec($stmt, $values = null): PDOStatement { try { $sth = parent::prepexec($stmt, $values); - } catch (\Exception $e) { + } catch (Exception $e) { $lostConnection = Str::contains($e->getMessage(), [ 'server has gone away', 'no connection to the server', @@ -46,7 +47,7 @@ public function prepexec($stmt, $values = null): PDOStatement try { $this->connect(); - } catch (\Exception $e) { + } catch (Exception $e) { $noConnection = Str::contains($e->getMessage(), [ 'No such file or directory', 'Connection refused' @@ -56,7 +57,7 @@ public function prepexec($stmt, $values = null): PDOStatement throw $e; } - \sleep(10); + sleep(10); $this->connect(); }