Skip to content

Commit 5c0af85

Browse files
authored
Merge pull request #51016 from nextcloud/backport/50874/stable30
[stable30] fix: Initialize lastConnectionCheck after first connection
2 parents b80f386 + d3b4b21 commit 5c0af85

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
@@ -218,15 +218,15 @@ public function connect($connectionName = null) {
218218
return parent::connect();
219219
}
220220

221-
$this->lastConnectionCheck[$this->getConnectionName()] = time();
222-
223221
// Only trigger the event logger for the initial connect call
224222
$eventLogger = Server::get(IEventLogger::class);
225223
$eventLogger->start('connect:db', 'db connection opened');
226224
/** @psalm-suppress InternalMethod */
227225
$status = parent::connect();
228226
$eventLogger->end('connect:db');
229227

228+
$this->lastConnectionCheck[$this->getConnectionName()] = time();
229+
230230
return $status;
231231
} catch (Exception $e) {
232232
// throw a new exception to prevent leaking info from the stacktrace

0 commit comments

Comments
 (0)