aboutsummaryrefslogtreecommitdiffstats
path: root/lib/base.php
diff options
context:
space:
mode:
authorJoas Schilling <213943+nickvergessen@users.noreply.github.com>2023-02-21 07:36:43 +0100
committerGitHub <noreply@github.com>2023-02-21 07:36:43 +0100
commit98ed72b3ed7e81a75d9a323c70a5e7f5af265a23 (patch)
treea92d3ab78f2fa52969139448a8aa7c509ed97af5 /lib/base.php
parent93e703bbfc7c8ef654b7b0185474397ec1bbaa6b (diff)
downloadnextcloud-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.php17
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,
+ ]);
+ }
});
}
}