Skip to content

Commit 662492b

Browse files
authored
Merge pull request #51018 from nextcloud/backport/50874/stable29
[stable29] fix: Initialize lastConnectionCheck after first connection
2 parents 687a4d9 + f9a4e80 commit 662492b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/private/DB/Connection.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,15 +152,15 @@ public function connect($connectionName = null) {
152152
return parent::connect();
153153
}
154154

155-
$this->lastConnectionCheck[$this->getConnectionName()] = time();
156-
157155
// Only trigger the event logger for the initial connect call
158156
$eventLogger = \OC::$server->get(IEventLogger::class);
159157
$eventLogger->start('connect:db', 'db connection opened');
160158
/** @psalm-suppress InternalMethod */
161159
$status = parent::connect();
162160
$eventLogger->end('connect:db');
163161

162+
$this->lastConnectionCheck[$this->getConnectionName()] = time();
163+
164164
return $status;
165165
} catch (Exception $e) {
166166
// throw a new exception to prevent leaking info from the stacktrace

0 commit comments

Comments
 (0)