mirror of
https://github.com/nextcloud/server.git
synced 2026-02-18 18:28:50 -05:00
fix(setup): ignore long session login during installation
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
This commit is contained in:
parent
b8b5f2c8aa
commit
9100b8757e
2 changed files with 11 additions and 4 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
[
|
||||
|
|
|
|||
Loading…
Reference in a new issue