diff --git a/library/Icingadb/ProvidedHook/Reporting/SlaReport.php b/library/Icingadb/ProvidedHook/Reporting/SlaReport.php index 3b4067ed..87c3c95a 100644 --- a/library/Icingadb/ProvidedHook/Reporting/SlaReport.php +++ b/library/Icingadb/ProvidedHook/Reporting/SlaReport.php @@ -127,6 +127,11 @@ abstract class SlaReport extends ReportHook $rd->setRows($rows); + // Disconnect from the database, as this hook usually runs isolated and no-one else requires a connection. + // Makes only a difference in case of reporting triggering this as part of a scheduled report and prevents + // the database connection from being left open unnecessarily and failing upon re-use. + $this->getDb()->disconnect(); + return $rd; }