Skip to content
Snippets Groups Projects
Commit 2fe677d0 authored by Vincent Petry's avatar Vincent Petry
Browse files

Catch cache garbage collection exception on postLogin

Just log the exception instead of preventing access to OC.
parent e339e6f4
Branches
No related tags found
No related merge requests found
...@@ -730,8 +730,14 @@ class OC { ...@@ -730,8 +730,14 @@ class OC {
// NOTE: This will be replaced to use OCP // NOTE: This will be replaced to use OCP
$userSession = self::$server->getUserSession(); $userSession = self::$server->getUserSession();
$userSession->listen('\OC\User', 'postLogin', function () { $userSession->listen('\OC\User', 'postLogin', function () {
try {
$cache = new \OC\Cache\File(); $cache = new \OC\Cache\File();
$cache->gc(); $cache->gc();
} catch (\Exception $e) {
// a GC exception should not prevent users from using OC,
// so log the exception
\OC::$server->getLogger()->warning('Exception when running cache gc: ' . $e->getMessage(), array('app' => 'core'));
}
}); });
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment