diff options
author | Maxence Lange <maxence@artificial-owl.com> | 2024-08-27 12:29:04 -0100 |
---|---|---|
committer | Maxence Lange <maxence@artificial-owl.com> | 2024-08-27 12:29:42 -0100 |
commit | 9100b8757e3cf9b5588ae58728e17fee6a38ced6 (patch) | |
tree | ee1ef4afd57053b38e3fb00f48613c2a53a88229 | |
parent | b8b5f2c8aae9429167914ee97474ef3697324330 (diff) | |
download | nextcloud-server-9100b8757e3cf9b5588ae58728e17fee6a38ced6.tar.gz nextcloud-server-9100b8757e3cf9b5588ae58728e17fee6a38ced6.zip |
fix(setup): ignore long session login during installation
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
-rw-r--r-- | lib/base.php | 7 | ||||
-rw-r--r-- | lib/private/Session/Internal.php | 8 |
2 files changed, 11 insertions, 4 deletions
diff --git a/lib/base.php b/lib/base.php index 6491c191d25..d0d030faf55 100644 --- a/lib/base.php +++ b/lib/base.php @@ -387,10 +387,15 @@ class OC { $sessionName = OC_Util::getInstanceId(); try { + $logger = null; + if (Server::get(\OC\SystemConfig::class)->getValue('installed', false)) { + $logger = logger('core'); + } + // set the session name to the instance id - which is unique $session = new \OC\Session\Internal( $sessionName, - logger('core'), + $logger, ); $cryptoWrapper = Server::get(\OC\Session\CryptoWrapper::class); diff --git a/lib/private/Session/Internal.php b/lib/private/Session/Internal.php index 5398dc710af..b465bcd3eda 100644 --- a/lib/private/Session/Internal.php +++ b/lib/private/Session/Internal.php @@ -29,8 +29,10 @@ class Internal extends Session { * @param string $name * @throws \Exception */ - public function __construct(string $name, - private LoggerInterface $logger) { + public function __construct( + string $name, + private ?LoggerInterface $logger, + ) { set_error_handler([$this, 'trapError']); $this->invoke('session_name', [$name]); $this->invoke('session_cache_limiter', ['']); @@ -204,7 +206,7 @@ class Internal extends Session { $timeSpent > 0.5 => ILogger::INFO, default => ILogger::DEBUG, }; - $this->logger->log( + $this->logger?->log( $logLevel, "Slow session operation $functionName detected", [ |