Catch cache garbage collection exception on postLogin
Just log the exception instead of preventing access to OC.
This commit is contained in:
parent
e339e6f497
commit
2fe677d0ed
1 changed files with 8 additions and 2 deletions
10
lib/base.php
10
lib/base.php
|
@ -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'));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue