From 98ed72b3ed7e81a75d9a323c70a5e7f5af265a23 Mon Sep 17 00:00:00 2001 From: Joas Schilling <213943+nickvergessen@users.noreply.github.com> Date: Tue, 21 Feb 2023 07:36:43 +0100 Subject: Revert "fix(performance): Do not set up filesystem on every call" --- lib/base.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'lib/base.php') diff --git a/lib/base.php b/lib/base.php index 452d6ecc05d..b5c5845b5a0 100644 --- a/lib/base.php +++ b/lib/base.php @@ -855,6 +855,23 @@ class OC { $throttler = Server::get(\OC\Security\Bruteforce\Throttler::class); $throttler->resetDelay($request->getRemoteAddress(), 'login', ['user' => $uid]); } + + try { + $cache = new \OC\Cache\File(); + $cache->gc(); + } catch (\OC\ServerNotAvailableException $e) { + // not a GC exception, pass it on + throw $e; + } catch (\OC\ForbiddenException $e) { + // filesystem blocked for this request, ignore + } catch (\Exception $e) { + // a GC exception should not prevent users from using OC, + // so log the exception + Server::get(LoggerInterface::class)->warning('Exception when running cache gc.', [ + 'app' => 'core', + 'exception' => $e, + ]); + } }); } } -- cgit v1.2.3