diff options
author | Joas Schilling <213943+nickvergessen@users.noreply.github.com> | 2023-02-21 07:36:43 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-21 07:36:43 +0100 |
commit | 98ed72b3ed7e81a75d9a323c70a5e7f5af265a23 (patch) | |
tree | a92d3ab78f2fa52969139448a8aa7c509ed97af5 /lib/base.php | |
parent | 93e703bbfc7c8ef654b7b0185474397ec1bbaa6b (diff) | |
download | nextcloud-server-98ed72b3ed7e81a75d9a323c70a5e7f5af265a23.tar.gz nextcloud-server-98ed72b3ed7e81a75d9a323c70a5e7f5af265a23.zip |
Revert "fix(performance): Do not set up filesystem on every call"
Diffstat (limited to 'lib/base.php')
-rw-r--r-- | lib/base.php | 17 |
1 files changed, 17 insertions, 0 deletions
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, + ]); + } }); } } |