diff --git a/lib/private/DB/Connection.php b/lib/private/DB/Connection.php index 1b61cc83319ac..e2e36f83c8844 100644 --- a/lib/private/DB/Connection.php +++ b/lib/private/DB/Connection.php @@ -218,8 +218,6 @@ public function connect($connectionName = null) { return parent::connect(); } - $this->lastConnectionCheck[$this->getConnectionName()] = time(); - // Only trigger the event logger for the initial connect call $eventLogger = Server::get(IEventLogger::class); $eventLogger->start('connect:db', 'db connection opened'); @@ -227,6 +225,8 @@ public function connect($connectionName = null) { $status = parent::connect(); $eventLogger->end('connect:db'); + $this->lastConnectionCheck[$this->getConnectionName()] = time(); + return $status; } catch (Exception $e) { // throw a new exception to prevent leaking info from the stacktrace