Skip to content

Commit e56d8a6

Browse files
committed
SlaReport: Disconnect from the database when done
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.
1 parent c1ff12c commit e56d8a6

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

library/Icingadb/ProvidedHook/Reporting/SlaReport.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,11 @@ protected function fetchReportData(Timerange $timerange, array $config = null)
127127

128128
$rd->setRows($rows);
129129

130+
// Disconnect from the database, as this hook usually runs isolated and no-one else requires a connection.
131+
// Makes only a difference in case of reporting triggering this as part of a scheduled report and prevents
132+
// the database connection from being left open unnecessarily and failing upon re-use.
133+
$this->getDb()->disconnect();
134+
130135
return $rd;
131136
}
132137

0 commit comments

Comments
 (0)