Skip to content

Commit

Permalink
Merge pull request #51018 from nextcloud/backport/50874/stable29
Browse files Browse the repository at this point in the history
[stable29] fix: Initialize lastConnectionCheck after first connection
  • Loading branch information
come-nc authored Feb 25, 2025
2 parents 687a4d9 + f9a4e80 commit 662492b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/private/DB/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,15 +152,15 @@ 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');
/** @psalm-suppress InternalMethod */
$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
Expand Down

0 comments on commit 662492b

Please sign in to comment.