mirror of
https://github.com/nextcloud/server.git
synced 2026-06-14 19:20:35 -04:00
Avoid db connection when logging db connection errors
`\OC\Log\LogDetails::logDetails` depends on `\OC_App::getAppVersions()` which makes a database connection causing the logger to break when the database service is unavaiable. Signed-off-by: fenn-cs <fenn25.fn@gmail.com>
This commit is contained in:
parent
bb2c2bb7f0
commit
d0fc159975
1 changed files with 7 additions and 1 deletions
|
|
@ -730,7 +730,13 @@ class Server extends ServerContainer implements IServerContainer {
|
|||
|
||||
if ($config->getSystemValueBool('installed', false) && !(defined('PHPUNIT_RUN') && PHPUNIT_RUN)) {
|
||||
if (!$config->getSystemValueBool('log_query')) {
|
||||
$v = \OC_App::getAppVersions();
|
||||
try {
|
||||
$v = \OC_App::getAppVersions();
|
||||
} catch (\Doctrine\DBAL\Exception $e) {
|
||||
// Database service probably unavailable
|
||||
// Probably related to https://github.com/nextcloud/server/issues/37424
|
||||
return $arrayCacheFactory;
|
||||
}
|
||||
} else {
|
||||
// If the log_query is enabled, we can not get the app versions
|
||||
// as that does a query, which will be logged and the logging
|
||||
|
|
|
|||
Loading…
Reference in a new issue