diff --git a/lib/private/DB/Connection.php b/lib/private/DB/Connection.php index 6e2db8e47bcd3..ff365c9b10084 100644 --- a/lib/private/DB/Connection.php +++ b/lib/private/DB/Connection.php @@ -152,8 +152,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 = \OC::$server->get(IEventLogger::class); $eventLogger->start('connect:db', 'db connection opened'); @@ -161,6 +159,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