aboutsummaryrefslogtreecommitdiffstats
path: root/lib/base.php
diff options
context:
space:
mode:
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,
+ ]);
+ }
});
}
}