Catch cache garbage collection exception on postLogin

Just log the exception instead of preventing access to OC.
This commit is contained in:
Vincent Petry 2015-06-30 17:36:55 +02:00
parent e339e6f497
commit 2fe677d0ed
1 changed files with 8 additions and 2 deletions

View File

@ -730,8 +730,14 @@ class OC {
// NOTE: This will be replaced to use OCP
$userSession = self::$server->getUserSession();
$userSession->listen('\OC\User', 'postLogin', function () {
$cache = new \OC\Cache\File();
$cache->gc();
try {
$cache = new \OC\Cache\File();
$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'));
}
});
}
}