Skip to content

Commit 9e94cf2

Browse files
committed
perf(base): Stop setting up the FS for every basic auth request
Signed-off-by: provokateurin <kate@provokateurin.de>
1 parent 6181754 commit 9e94cf2

2 files changed

Lines changed: 1 addition & 17 deletions

File tree

apps/files_sharing/tests/TestCase.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ protected function loginHelper($user, $create = false, $password = false) {
196196
Server::get(IUserSession::class)->setUser(null);
197197
Filesystem::tearDown();
198198
Server::get(IUserSession::class)->login($user, $password);
199+
Filesystem::initMountPoints($user);
199200
\OC::$server->getUserFolder($user);
200201

201202
\OC_Util::setupFS($user);

lib/base.php

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -883,23 +883,6 @@ public static function registerCleanupHooks(\OC\SystemConfig $systemConfig): voi
883883
$throttler = Server::get(IThrottler::class);
884884
$throttler->resetDelay($request->getRemoteAddress(), 'login', ['user' => $uid]);
885885
}
886-
887-
try {
888-
$cache = new \OC\Cache\File();
889-
$cache->gc();
890-
} catch (\OC\ServerNotAvailableException $e) {
891-
// not a GC exception, pass it on
892-
throw $e;
893-
} catch (\OC\ForbiddenException $e) {
894-
// filesystem blocked for this request, ignore
895-
} catch (\Exception $e) {
896-
// a GC exception should not prevent users from using OC,
897-
// so log the exception
898-
Server::get(LoggerInterface::class)->warning('Exception when running cache gc.', [
899-
'app' => 'core',
900-
'exception' => $e,
901-
]);
902-
}
903886
});
904887
}
905888
}

0 commit comments

Comments
 (0)